(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

This commit is contained in:
yexo
2009-08-19 16:14:15 +00:00
parent 2612f46a20
commit c22f60c812
8 changed files with 46 additions and 5 deletions

View File

@@ -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;