Loading

Paste #pkbvssddy

  1. /**
  2. * Check whether a Game Script is not running, or if it is running, if it is dead.
  3. * Check whether an AI slot is not started, or if it is started, it is not an AI, or if it is an AI, if it is dead.
  4. * @param slot The slot that is checked.
  5. * @return true if the slot that is checked is dead.
  6. */
  7. static bool IsDead(CompanyID slot)
  8. {
  9.     if (slot == OWNER_DEITY) {
  10.         return Game::GetInstance() == NULL || Game::GetInstance()->IsDead();
  11.     } else {
  12.         return !Company::IsValidAiID(slot) || Company::Get(slot)->ai_instance->IsDead();
  13.     }
  14. }

Comments