From 5bcdcdd1d17720be013b26ab91218bccc04bdc78 Mon Sep 17 00:00:00 2001 From: Yexo Date: Sun, 8 Feb 2009 11:34:51 +0000 Subject: (svn r15408) -Fix (r15027): AIs could call AIController::Sleep() at times they're not allowed to sleep. --- src/ai/api/ai_controller.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ai') diff --git a/src/ai/api/ai_controller.cpp b/src/ai/api/ai_controller.cpp index 96f9715a8..d11a2add5 100644 --- a/src/ai/api/ai_controller.cpp +++ b/src/ai/api/ai_controller.cpp @@ -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; -- cgit v1.2.3-70-g09d2