From a58427115cbf7569fad746c588cd93a9bd14b57f Mon Sep 17 00:00:00 2001 From: zuu Date: Wed, 29 May 2013 19:31:58 +0000 Subject: (svn r25305) -Fix [FS#5561]: Game Script APIs that execute a DoCommand were returning the same result as in TestMode during world generation --- src/script/api/script_object.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/script/api') 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. */ -- cgit v1.2.3-70-g09d2