* Check whether a company is a valid AI company or GS. * @param company Company to check for validity. * @return true if company is valid for debugging. */
| 711 | * @return true if company is valid for debugging. |
| 712 | */ |
| 713 | bool IsValidDebugCompany(CompanyID company) const |
| 714 | { |
| 715 | switch (company.base()) { |
| 716 | case CompanyID::Invalid().base(): return false; |
| 717 | case OWNER_DEITY.base(): return Game::GetInstance() != nullptr; |
| 718 | default: return Company::IsValidAiID(company); |
| 719 | } |
| 720 | } |
| 721 | |
| 722 | /** |
| 723 | * Ensure that \c script_debug_company refers to a valid AI company or GS, or is set to #CompanyID::Invalid(). |
no test coverage detected