1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-31 18:39:10 +00:00

(svn r15408) -Fix (r15027): AIs could call AIController::Sleep() at times they're not allowed to sleep.

This commit is contained in:
Yexo
2009-02-08 11:34:51 +00:00
parent 5f8c2b1b4e
commit 5bcdcdd1d1

View File

@@ -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;