bool CScriptGameObject::Alive () const { CEntity *entity = smart_cast<CEntity*>(&object()); if (!entity) { ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CSciptEntity : cannot access class member Alive!"); return (false); } return (!!entity->g_Alive()); }
CEntity *CBaseMonster::GetCurrentCorpse() { CEntity *corpse = 0; if (CorpseMan.get_corpse()) corpse = const_cast<CEntity *>(smart_cast<const CEntity*>(CorpseMan.get_corpse())); if (!corpse || corpse->getDestroy() || corpse->g_Alive()) corpse = 0; return (corpse); }
CEntity *CBaseMonster::GetCurrentEnemy() { CEntity *enemy = 0; if (EnemyMan.get_enemy()) enemy = const_cast<CEntity *>(smart_cast<const CEntity*>(EnemyMan.get_enemy())); if (!enemy || enemy->getDestroy() || !enemy->g_Alive()) enemy = 0; return (enemy); }
CEntity *CBaseMonster::GetCurrentEnemy() { VERIFY (g_Alive()); CEntity *enemy = 0; if (EnemyMan.get_enemy()) enemy = const_cast<CEntity*>(static_cast<CEntity const*>(EnemyMan.get_enemy())); if (!enemy || enemy->getDestroy() || !enemy->g_Alive()) enemy = 0; return (enemy); }