1
0
Fork 0

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

release/0.7
Yexo 2009-02-08 11:34:51 +00:00
parent 5f8c2b1b4e
commit 5bcdcdd1d1
1 changed files with 5 additions and 0 deletions

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;