Not logged inOpenClonk Forum
Up Topic How are you using the RemoveObject-zeroes-variables feature?

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Günther
With references gone, objects are the only user of C4Value::NextRef. And the only purpose is to keep a list of all variables that contain a given object so that they can all be set to nil when the object is removed. I suspect that removing that list could speed up C4Script a bit. The engine already has machinery in place to deal with references to removed objects: They are kept until the end of the frame and then removed. We could easily extend that to keep objects that have references from script. That would have observable implications for scripts, though, so I'd want to study scripts that rely on variables containing an object changing to nil on RemoveObject/Explode/Sale/etc. of an object. Does anyone know examples? Do you routinely check a variable for nil to find out whether an object still exists, or do you use the Destruction callback?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill