summaryrefslogtreecommitdiff
path: root/src/script/api/script_object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/script_object.cpp')
-rw-r--r--src/script/api/script_object.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp
index 7da23d6f7..2852c4ae9 100644
--- a/src/script/api/script_object.cpp
+++ b/src/script/api/script_object.cpp
@@ -300,7 +300,12 @@ ScriptObject::ActiveInstance::~ActiveInstance()
if (_generating_world) {
IncreaseDoCommandCosts(res.GetCost());
- if (callback != NULL) callback(GetActiveInstance());
+ if (callback != NULL) {
+ /* Insert return value into to stack and throw a control code that
+ * the return value in the stack should be used. */
+ callback(GetActiveInstance());
+ throw SQInteger(1);
+ }
return true;
} else if (_networking) {
/* Suspend the script till the command is really executed. */