diff options
author | yexo <yexo@openttd.org> | 2009-08-19 16:14:15 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-08-19 16:14:15 +0000 |
commit | a4afa140f36673cd7dac1277aa4dd1d45618363b (patch) | |
tree | 8617da9c602cfe25338ae27da8ba08bc8ff6415c /src/ai/ai_instance.hpp | |
parent | 0780dc8138ae6edf3aee217f48e7759804a95464 (diff) | |
download | openttd-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/ai_instance.hpp')
-rw-r--r-- | src/ai/ai_instance.hpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp index f260d46d4..c93bf0472 100644 --- a/src/ai/ai_instance.hpp +++ b/src/ai/ai_instance.hpp @@ -18,7 +18,7 @@ public: AI_VMSuspend(int time, AISuspendCallbackProc *callback) : time(time), callback(callback) - {} + {} int GetSuspendTime() { return time; } AISuspendCallbackProc *GetSuspendCallback() { return callback; } @@ -28,6 +28,21 @@ private: AISuspendCallbackProc *callback; }; +/** + * A throw-class that is given when the AI made a fatal error. + */ +class AI_FatalError { +public: + AI_FatalError(const char *msg) : + msg(msg) + {} + + const char *GetErrorMessage() { return msg; } + +private: + const char *msg; +}; + class AIInstance { public: friend class AIObject; |