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 Zapper

>Do you routinely check a variable for nil to find out whether an object still exists, or do you use the Destruction callback?


You would usually check it for nil.
Some examples; Hitchecks:
pEnemy->DoEnergy(-1000000);
if(pEnemy) // not disintegrated by BFG
   pEnemy->PlayOuchSound();

pEnemy->Deflect(pProjectile);
if(pProjectile) // not removed by a shield
    pProjectile->Hit();

Stuff like that where you just cannot overload the object for some Destruction callback.
Are the references not using some kind of magic number? So that you can quickly see whether a reference is valid?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill