/** My Code, I want IsDead compatible with the 3 structs */
static bool IsDead(CompanyID slot)
{
if (slot == OWNER_DEITY) {
return Game::GetInstance()->IsDead();
} else {
return !Company::IsValidAiID(slot) || Company::Get(slot)->ai_instance->IsDead();
}
}
struct AISettingsWindow : public Window {
bla;
}
struct AIConfigWindow : public Window {
bla;
}
struct AIDebugWindow : public Window {
bla;
}
/** Original Code, there's an IsDead only, inside Debug struct*/
struct AISettingsWindow : public Window {
bla;
}
struct AIConfigWindow : public Window {
bla;
}
struct AIDebugWindow : public Window {
bool IsDead() const
{
if (ai_debug_company == OWNER_DEITY) {
GameInstance *game = Game::GetInstance();
return game == NULL || game->IsDead();
}
return !Company::IsValidAiID(ai_debug_company) || Company::Get(ai_debug_company)->ai_instance->IsDead();
}
bla;
}