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

Method Died

src/game/game_instance.cpp:68–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void GameInstance::Died()
69{
70 ScriptInstance::Died();
71
72 /* Don't show errors while loading savegame. They will be shown at end of loading anyway. */
73 if (_switch_mode != SM_NONE) return;
74
75 ShowScriptDebugWindow(OWNER_DEITY);
76
77 const GameInfo *info = Game::GetInfo();
78 if (info != nullptr) {
79 ShowErrorMessage(GetEncodedString(STR_ERROR_AI_PLEASE_REPORT_CRASH), {}, WL_WARNING);
80
81 if (!info->GetURL().empty()) {
82 ScriptLog::Info("Please report the error to the following URL:");
83 ScriptLog::Info(info->GetURL());
84 }
85 }
86}
87
88/**
89 * DoCommand callback function for all commands executed by Game Scripts.

Callers 1

RegisterAPIMethod · 0.95

Calls 5

ShowScriptDebugWindowFunction · 0.85
ShowErrorMessageFunction · 0.85
GetURLMethod · 0.80
GetEncodedStringFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected