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/script/api | |
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/script/api')
-rw-r--r-- | src/script/api/script_controller.cpp | 3 | ||||
-rw-r--r-- | src/script/api/script_object.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/script/api/script_controller.cpp b/src/script/api/script_controller.cpp index bc6d060fd..e81af3603 100644 --- a/src/script/api/script_controller.cpp +++ b/src/script/api/script_controller.cpp @@ -21,6 +21,7 @@ #include "../../ai/ai_config.hpp" #include "../../ai/ai.hpp" #include "../script_fatalerror.hpp" +#include "../script_suspend.hpp" #include "script_log.hpp" /* static */ void ScriptController::SetCommandDelay(int ticks) @@ -40,7 +41,7 @@ ticks = 1; } - throw AI_VMSuspend(ticks, NULL); + throw Script_Suspend(ticks, NULL); } /* static */ void ScriptController::Print(bool error_msg, const char *message) diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index cb01d3ee3..8cc9263c5 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -18,6 +18,7 @@ #include "../script_storage.hpp" #include "../../ai/ai_instance.hpp" #include "../script_fatalerror.hpp" +#include "../script_suspend.hpp" #include "script_error.hpp" /** @@ -265,7 +266,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() if (_networking) { /* Suspend the AI till the command is really executed. */ - throw AI_VMSuspend(-(int)GetDoCommandDelay(), callback); + throw Script_Suspend(-(int)GetDoCommandDelay(), callback); } else { IncreaseDoCommandCosts(res.GetCost()); @@ -273,7 +274,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() * both avoids confusion when a developer launched his AI in a * multiplayer game, but also gives time for the GUI and human player * to interact with the game. */ - throw AI_VMSuspend(GetDoCommandDelay(), callback); + throw Script_Suspend(GetDoCommandDelay(), callback); } NOT_REACHED(); |