/** * Check whether a script, be it AI or GS, is dead in this slot. * @note Also returns dead for AI slots which are currently occupied * by Human Companies or when the AI didn't start. * @note Also returns dead when no GS was set up. * @param slot The slot that is checked. * @return true if the slot that is checked is dead. */ static bool IsDead(CompanyID slot) { if (slot == OWNER_DEITY) { return Game::GetInstance() == NULL || Game::GetInstance()->IsDead(); } else { return !Company::IsValidAiID(slot) || Company::Get(slot)->ai_instance->IsDead(); } }