Loading

Paste #pna6tfy4s

  1. /* old code */
  2. static bool IsDead(CompanyID slot)
  3. {
  4.     if (slot == OWNER_DEITY) {
  5.         return Game::GetInstance() == NULL || Game::GetInstance()->IsDead();
  6.     } else {
  7.         return !Company::IsValidAiID(slot) || Company::Get(slot)->ai_instance->IsDead();
  8.     }
  9. }
  10.  
  11.  
  12. /* new code function 1 */
  13. static bool IsStarted(CompanyID slot)
  14. {
  15.     if (slot == OWNER_DEITY) {
  16.         return !Game::GetInstance() == NULL;
  17.     } else {
  18.         return Company::IsValidAiID(slot);
  19.     }
  20. }
  21.  
  22. /* new code function 2 */
  23. static bool IsDead(CompanyID slot)
  24. {
  25.     assert (IsStarted(slot));
  26.     if (slot == OWNER_DEITY) {
  27.         return Game::GetInstance()->IsDead();
  28.     } else {
  29.         return Company::Get(slot)->ai_instance->IsDead();
  30.     }
  31. }

Version history

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

Comments