mirror of https://github.com/OpenTTD/OpenTTD
(svn r15408) -Fix (r15027): AIs could call AIController::Sleep() at times they're not allowed to sleep.
parent
5f8c2b1b4e
commit
5bcdcdd1d1
|
@ -22,6 +22,11 @@
|
|||
|
||||
/* static */ void AIController::Sleep(int ticks)
|
||||
{
|
||||
if (!AIObject::GetAllowDoCommand()) {
|
||||
AILog::Error("You are not allowed to call Sleep in your constructor, Save(), Load(), and any valuator.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ticks <= 0) {
|
||||
AILog::Warning("Sleep() value should be > 0. Assuming value 1.");
|
||||
ticks = 1;
|
||||
|
|
Loading…
Reference in New Issue