I absolutely hate having to use this:
if(entity != NULL)
{
if(entity.skill1 == 1)
{
//yuck.
}
}
That kind of code is everywhere in GRUNTS. It seems that every time I turn around... An entity has disappeared.
What's obnoxious is when I have to perform a "dangerous instruction" such as c_trace in an event function. I have to put a wait(1) statement before the instruction or the engine will spit out an error message... But then there's a chance that my pointers will be invalid. So I have to perform another check. And then another, because I want to see if c_trace hit an entity.
if( event_type == EVENT_IMPACT )
{
if( your ) // ok, "you" are an entity...
{
wait(1); // I want to perform a c_trace. Gotta wait...
if( your ) // pointers may be null! Another check...
{
c_trace( ARGUMENTS );
if( your ) // another blasted check!
{
// code 'n stuff
}
}
}
}