Skip to content
Browse files

qtscript: pickStructLocation() now returns a full POSITION object,

  • Loading branch information...
1 parent 8070f6b commit f3e5f9b98b1a3cfd7e9dee516070da018bd5b084 @perim perim committed Oct 7, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/qtscriptfuncs.cpp
3 src/qtscriptfuncs.cpp
@@ -1145,7 +1145,7 @@ static QScriptValue js_debug(QScriptContext *context, QScriptEngine *engine)
//-- \subsection{pickStructLocation(droid, structure type, x, y)}
//-- Pick a location for constructing a certain type of building near some given position.
-//-- Returns a position object containing "x" and "y" values, if successful.
+//-- Returns an object containing "type" POSITION, and "x" and "y" values, if successful.
static QScriptValue js_pickStructLocation(QScriptContext *context, QScriptEngine *engine)
QScriptValue droidVal = context->argument(0);
@@ -1235,6 +1235,7 @@ static QScriptValue js_pickStructLocation(QScriptContext *context, QScriptEngine
QScriptValue retval = engine->newObject();
retval.setProperty("x", x + map_coord(offset.x), QScriptValue::ReadOnly);
retval.setProperty("y", y + map_coord(offset.y), QScriptValue::ReadOnly);
+ retval.setProperty("type", SCRIPT_POSITION, QScriptValue::ReadOnly);
return retval;

0 comments on commit f3e5f9b

Please sign in to comment.
Something went wrong with that request. Please try again.