Category: Objects / Existence
Since engine version: 1.0 OC


Removes the calling object.


void RemoveObject(bool eject_contents);


[opt] If true, the object's contents is exited before deletion of the object. Otherwise, the contents will be deleted as well.


When removing an object, numerous internal references to the object are cleared and any pointer to the object will become invalid. If you have stored a pointer to this object (e.g. in thread local script) you must no longer use this pointer after deletion of the object. If an object removes itself by script it should not execute any more script commands following the removal. The deleting function should immediately end with return.
If the object is a valid crew member at the time of removal, the associated info object in the crew list will not be marked as 'killed', meaning a subsequent call to MakeCrewMember() might reuse the same crew info. To properly kill a clonk until the end of a round use Kill().
See also: CreateObject, Explode, Kill
Sven2, 2002-08