1. You are not checking if EntityBase is a valid address. Add an if statement:
Code:
if ( !EntityBase ) continue;
2. You are checking lifeState incorrectly.
Code:
if (EntityLifeState != true)
continue;
The correct enum is the following:
Code:
enum LifeState {
LIFE_ALIVE = 0,// alive
LIFE_DYING = 1, // playing death animation or still falling off of a ledge waiting to hit ground
LIFE_DEAD = 2 // dead. lying still.
};
You're essentially checking if the enemy is alive, and if it is, continue. ( != true means that you're checking if it's 0, and if it is, you continue )
Code:
if ( EntityLifeState ) continue;
is all it takes.