(svn r25305) -Fix [FS#5561]: Game Script APIs that execute a DoCommand were returning the same result as in TestMode during world generation

This commit is contained in:
zuu
2013-05-29 19:31:58 +00:00
parent 24498a5912
commit 7661336b2d
2 changed files with 14 additions and 5 deletions

View File

@@ -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. */