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

> Projectiles and weapons shouldn't hit dead objects. Floor switches shouldn't be affected by dead objects.


Those would use FindObject and not be affected either way.

> Animals shouldn't follow dead objects.


They shouldn't follow objects that are simply out of reach in other ways either. Checking for Teleportation or for the objects not being Alive() automatically covers dead objects.

> Fire should stop burning when its object is dead


Effects rely on callbacks for that, or for the effect to simply be removed with the object.

> and dead objects shouldn't be able to catch fire again.


They can't get effects, so that's already covered.

> Just about any object interaction would need to check for dead objects (just like the engine does all those status-checks) AND still check for zero pointers in most cases.


Well, not in the examples you listed. Also, checking for nullpointers would only be required if you want to guard against some other script tampering with your local variables. In my opinion, it's the responsibility of the script setting a variable to ensure that nothing bad happens. So if your interaction consists of obj->SetRDir(), you now need to check for nullpointers, but you don't need to do that anymore with the proposed change, because SetRDir() is harmless on dead objects.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill