Loading

Paste #pcutdxwf1

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

Version history

Revision # Author Created at
pna6tfy4s Anonymous 29 Apr 2016, 22:25:39 UTC Diff
pkbvssddy Anonymous 29 Apr 2016, 20:44:41 UTC Diff

Comments