Just to be sure, if you call IsLive() on a dead unit, the unitID gets set to 0, right?
// Untested pseudo codeint _Unit::IsLive(){ Â if (this->unitIndex == 0) Â Â return FALSE; Â Unit* unit = map.unit[this->unitIndex]; Â if ((unit->next != -1) && ((unit->flags & IsDeadFlag) == 0)) Â Â return TRUE; Â this->unitIndex = 0; Â // Â ** Clear unitIndex to 0 Â return FALSE;}