diff options
-rw-r--r-- | src/ai/api/ai_controller.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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; |