File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5706,8 +5706,21 @@ Can be gotten via `minetest.get_node_timer(pos)`.
5706
5706
-----------
5707
5707
5708
5708
Moving things in the game are generally these.
5709
+ This is basically a reference to a C++ `ServerActiveObject`.
5710
+
5711
+ ### Advice on handling `ObjectRefs`
5712
+
5713
+ When you receive an `ObjectRef` as a callback argument or from another API
5714
+ function, it is possible to store the reference somewhere and keep it around.
5715
+ It will keep functioning until the object is unloaded or removed.
5716
+
5717
+ However, doing this is **NOT** recommended as there is (intentionally) no method
5718
+ to test if a previously acquired `ObjectRef` is still valid.
5719
+ Instead, `ObjectRefs` should be "let go" of as soon as control is returned from
5720
+ Lua back to the engine.
5721
+ Doing so is much less error-prone and you will never need to wonder if the
5722
+ object you are working with still exists.
5709
5723
5710
- This is basically a reference to a C++ `ServerActiveObject`
5711
5724
5712
5725
### Methods
5713
5726
You can’t perform that action at this time.
0 commit comments