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

Method Sleep

src/script/api/script_controller.cpp:34–46  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

32}
33
34/* static */ void ScriptController::Sleep(int ticks)
35{
36 if (!ScriptObject::CanSuspend()) {
37 throw Script_FatalError("You are not allowed to call Sleep in your constructor, Save(), Load(), and any valuator.");
38 }
39
40 if (ticks <= 0) {
41 ScriptLog::Warning("Sleep() value should be > 0. Assuming value 1.");
42 ticks = 1;
43 }
44
45 throw Script_Suspend(ticks, nullptr);
46}
47
48/* static */ void ScriptController::Break(const std::string &message)
49{

Callers

nothing calls this directly

Calls 2

Script_FatalErrorClass · 0.85
Script_SuspendClass · 0.85

Tested by

no test coverage detected