UTIL Remove: Difference between revisions
Jump to navigation
Jump to search
m (linked the german translation) |
m (Translation stuff.) |
||
Line 1: | Line 1: | ||
{{ | {{lang|UTIL_Remove}} | ||
| | |||
}} | |||
UTIL_Remove is a [[UTIL]] provided in the Source code for removing objects. UTIL_Remove marks an object for deletion ''on the next frame'', instead of the current one. Removing objects on the current frame can cause null pointers '''which will cause the game to crash''', so UTIL_Remove is included to prevent this. | UTIL_Remove is a [[UTIL]] provided in the Source code for removing objects. UTIL_Remove marks an object for deletion ''on the next frame'', instead of the current one. Removing objects on the current frame can cause null pointers '''which will cause the game to crash''', so UTIL_Remove is included to prevent this. | ||
==Usage== | |||
== Usage == | |||
<source lang=cpp>void UTIL_Remove( IServerNetworkable *oldObj )</source> | <source lang=cpp>void UTIL_Remove( IServerNetworkable *oldObj )</source> | ||
==Examples== | |||
== Examples == | |||
<source lang=cpp> | <source lang=cpp> | ||
Line 24: | Line 20: | ||
</source> | </source> | ||
== See Also == | ==See Also== | ||
* [[UTIL_RemoveImmediate]] | * [[UTIL_RemoveImmediate]] | ||
* [[UTIL_EnableRemoveImmediate]] | * [[UTIL_EnableRemoveImmediate]] |
Revision as of 03:34, 29 August 2021
UTIL_Remove is a UTIL provided in the Source code for removing objects. UTIL_Remove marks an object for deletion on the next frame, instead of the current one. Removing objects on the current frame can cause null pointers which will cause the game to crash, so UTIL_Remove is included to prevent this.
Usage
void UTIL_Remove( IServerNetworkable *oldObj )
Examples
UTIL_Remove( this );
CBaseFire *pEffect = m_hEffect;
if ( pEffect != NULL )
{
UTIL_Remove( pEffect );
m_hEffect = NULL;
}