Skip to content

Commit b313aca

Browse files
authored
Update 2024-02-29-creating-the-perfect-modding-language.md
1 parent 420742b commit b313aca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_posts/2024-02-29-creating-the-perfect-modding-language.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ on_foo() {
134134
}
135135
```
136136

137-
This means that a game function like <span style="color:#C792EA">`list_add`</span> will need to make a copy of the local `entity` it was passed, as the local `entity` gets freed at the end of the <span style="color:#C3E88D">`on_tick`</span> function. If it didn't make a copy, the below <span style="color:#C792EA">`print_list`</span> game function call would try to print a freed entity during the second <span style="color:#C3E88D">`on_tick`</span> call:
137+
This means that a game function like <span style="color:#C792EA">`list_add`</span> will need to make a copy of the local `entity` it was passed, as the local `entity` gets freed at the end of the <span style="color:#C3E88D">`on_tick`</span> function. Copies are basically free if you have any way of reference counting the object. If it didn't make a copy, the below <span style="color:#C792EA">`print_list`</span> game function call would try to print a freed entity during the second <span style="color:#C3E88D">`on_tick`</span> call:
138138

139139
```grug
140140
entities: id = list()

0 commit comments

Comments
 (0)