diff options
author | truebrain <truebrain@openttd.org> | 2011-11-29 23:21:24 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-29 23:21:24 +0000 |
commit | 75c4bd280a720592ec4df26efbedd9df5baa2d8f (patch) | |
tree | 7e4a3248a93b55f9add46b9935bf3e1d8da93c84 /src/ai/ai_instance.cpp | |
parent | bbd9facb44dc09ded5500918319b770c63c0a981 (diff) | |
download | openttd-75c4bd280a720592ec4df26efbedd9df5baa2d8f.tar.xz |
(svn r23359) -Codechange: move AI_VMSuspend to Script_Suspend (and to its own file)
Diffstat (limited to 'src/ai/ai_instance.cpp')
-rw-r--r-- | src/ai/ai_instance.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 324242957..a4a30334f 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -18,8 +18,9 @@ #include "ai_config.hpp" #include "ai_gui.hpp" -#include "../script/script_fatalerror.hpp" +#include "../script/script_fatalerror.hpp" +#include "../script/script_suspend.hpp" #include "../script/script_storage.hpp" #include "ai_instance.hpp" @@ -343,7 +344,7 @@ void AIInstance::GameLoop() } try { this->callback(this); - } catch (AI_VMSuspend e) { + } catch (Script_Suspend e) { this->suspend = e.GetSuspendTime(); this->callback = e.GetSuspendCallback(); @@ -373,7 +374,7 @@ void AIInstance::GameLoop() ScriptObject::SetAllowDoCommand(true); /* Start the AI by calling Start() */ if (!this->engine->CallMethod(*this->instance, "Start", _settings_game.ai.ai_max_opcode_till_suspend) || !this->engine->IsSuspended()) this->Died(); - } catch (AI_VMSuspend e) { + } catch (Script_Suspend e) { this->suspend = e.GetSuspendTime(); this->callback = e.GetSuspendCallback(); } catch (Script_FatalError e) { @@ -394,7 +395,7 @@ void AIInstance::GameLoop() /* Continue the VM */ try { if (!this->engine->Resume(_settings_game.ai.ai_max_opcode_till_suspend)) this->Died(); - } catch (AI_VMSuspend e) { + } catch (Script_Suspend e) { this->suspend = e.GetSuspendTime(); this->callback = e.GetSuspendCallback(); } catch (Script_FatalError e) { |