summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_object.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-08-19 16:14:15 +0000
committeryexo <yexo@openttd.org>2009-08-19 16:14:15 +0000
commita4afa140f36673cd7dac1277aa4dd1d45618363b (patch)
tree8617da9c602cfe25338ae27da8ba08bc8ff6415c /src/ai/api/ai_object.cpp
parent0780dc8138ae6edf3aee217f48e7759804a95464 (diff)
downloadopenttd-a4afa140f36673cd7dac1277aa4dd1d45618363b.tar.xz
(svn r17223) -Change [NoAI] [FS#2980]: Crash an AI when it uses a DoCommand / Sleep instead of just printing an error message in the AI Debug Window
Diffstat (limited to 'src/ai/api/ai_object.cpp')
-rw-r--r--src/ai/api/ai_object.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ai/api/ai_object.cpp b/src/ai/api/ai_object.cpp
index bb17e58f8..825c76c30 100644
--- a/src/ai/api/ai_object.cpp
+++ b/src/ai/api/ai_object.cpp
@@ -191,8 +191,7 @@ int AIObject::GetCallbackVariable(int index)
bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const char *text, AISuspendCallbackProc *callback)
{
if (AIObject::GetAllowDoCommand() == false) {
- AILog::Error("You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator.\n");
- return false;
+ throw AI_FatalError("You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator.");
}
CommandCost res;