Loading

Paste #plqlru8ut

  1. /** My Code, I want IsDead compatible with the 3 structs */
  2. static bool IsDead(CompanyID slot)
  3. {
  4.     if (slot == OWNER_DEITY) {
  5.         return Game::GetInstance()->IsDead();
  6.     } else {
  7.         return !Company::IsValidAiID(slot) || Company::Get(slot)->ai_instance->IsDead();
  8.     }
  9. }
  10. struct AISettingsWindow : public Window {
  11.     bla;
  12. }
  13. struct AIConfigWindow : public Window {
  14.     bla;
  15. }
  16. struct AIDebugWindow : public Window {
  17.     bla;
  18. }
  19.  
  20.  
  21. /** Original Code, there's an IsDead only, inside Debug struct*/
  22. struct AISettingsWindow : public Window {
  23.     bla;
  24. }
  25. struct AIConfigWindow : public Window {
  26.     bla;
  27. }
  28. struct AIDebugWindow : public Window {
  29.     bool IsDead() const
  30.     {
  31.         if (ai_debug_company == OWNER_DEITY) {
  32.             GameInstance *game = Game::GetInstance();
  33.             return game == NULL || game->IsDead();
  34.         }
  35.         return !Company::IsValidAiID(ai_debug_company) || Company::Get(ai_debug_company)->ai_instance->IsDead();
  36.     }
  37.     bla;
  38. }

Version history

Revision # Author Created at
powbjkea0 Anonymous 29 Apr 2016, 11:34:25 UTC Diff

Comments