-
-
Save SamuXarick/61f83b3b0e1a93e940130538f96299d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void SelectValidDebugCompany() | |
{ | |
/* Check if the currently selected company is still active. */ | |
if (this->IsValidDebugCompany(script_debug_company)) return; | |
script_debug_company = INVALID_COMPANY; | |
/* If no AI is available, see if there is a game script. */ | |
if (Game::GetInstance() != nullptr) { | |
ChangeToScript(OWNER_DEITY); | |
return; | |
} | |
for (const Company *c : Company::Iterate()) { | |
if (c->is_ai) { | |
ChangeToScript(c->index); | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment