MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsDead

Method IsDead

src/script/script_gui.cpp:699–706  ·  view source on GitHub ↗

* Check whether the currently selected AI/GS is dead. * @return true if dead. */

Source from the content-addressed store, hash-verified

697 * @return true if dead.
698 */
699 bool IsDead() const
700 {
701 if (this->filter.script_debug_company == OWNER_DEITY) {
702 GameInstance *game = Game::GetInstance();
703 return game == nullptr || game->IsDead();
704 }
705 return !Company::IsValidAiID(this->filter.script_debug_company) || Company::Get(this->filter.script_debug_company)->ai_instance->IsDead();
706 }
707
708 /**
709 * Check whether a company is a valid AI company or GS.

Callers 5

OnClickMethod · 0.95
OnInvalidateDataMethod · 0.95
UpdateAIButtonsStateMethod · 0.45
UpdateGSButtonStateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected