UTIL Remove: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (link)
m (linked the german translation)
Line 1: Line 1:
{{otherlang2
|de=UTIL_Remove:de
}}
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.



Revision as of 06:42, 16 April 2013

Template:Otherlang2 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;
}

See Also