gentity_t *UpdateGoal( void ) { gentity_t *goal; if ( !NPCInfo->goalEntity ) { return NULL; } if ( !NPCInfo->goalEntity->inuse ) {//Somehow freed it, but didn't clear it NPC_ClearGoal(); return NULL; } goal = NPCInfo->goalEntity; if ( ReachedGoal( goal ) ) { NPC_ReachedGoal(); goal = NULL;//so they don't keep trying to move to it }//else if fail, need to tell script so? return goal; }
gentity_t *UpdateGoal( void ) { //FIXME: CREED should look at this // this func doesn't seem to be working correctly for the sand creature gentity_t *goal; if ( !NPCInfo->goalEntity ) { return NULL; } if ( !NPCInfo->goalEntity->inuse ) {//Somehow freed it, but didn't clear it NPC_ClearGoal(); return NULL; } goal = NPCInfo->goalEntity; if ( ReachedGoal( goal ) ) { NPC_ReachedGoal(); goal = NULL;//so they don't keep trying to move to it }//else if fail, need to tell script so? return goal; }