Pt-br/UTIL Remove: Difference between revisions
< Pt-br
Jump to navigation
Jump to search
m (Using L template for links) |
m (obsolete language category) |
||
Line 27: | Line 27: | ||
{{ACategory|Programming}} | |||
{{ACategory|UTIL}} |
Latest revision as of 03:40, 22 August 2024
UTIL_Remove é um UTIL que temos no source code para remover objetos. UTIL_Remove marca um objeto para ser deletado no próximo frame e não no atual!. Removendo objetos no frame atual pode causar null pointers ,que podem travar o jogo, então o UTIL_remove é incluído para prevenir isso!
Como é usado
void UTIL_Remove( IServerNetworkable *oldObj );
Exemplo
UTIL_Remove( this );
CBaseFire *pEffect = m_hEffect;
if ( pEffect != NULL )
{
UTIL_Remove( pEffect );
m_hEffect = NULL;
}