summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-21 12:28:02 +0000
committertruebrain <truebrain@openttd.org>2011-12-21 12:28:02 +0000
commite1f04b89c3e39a945c61caa4a80b79a83ad19e90 (patch)
tree60bbf5126b5b23c0cca663ca809172a5c5cd69ff /src/script
parent726ce254ff204346125dce7daed0701dc5c8f724 (diff)
downloadopenttd-e1f04b89c3e39a945c61caa4a80b79a83ad19e90.tar.xz
(svn r23648) -Revert (r23646): partial revert; nobody has to know about my local changes and attempts
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_list.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/script/api/script_list.cpp b/src/script/api/script_list.cpp
index f6f2f4596..14d400bcb 100644
--- a/src/script/api/script_list.cpp
+++ b/src/script/api/script_list.cpp
@@ -818,15 +818,13 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
sq_push(vm, 2);
for (ScriptListMap::iterator iter = this->items.begin(); iter != this->items.end(); iter++) {
- int key = (*iter).first;
-
/* Check for changing of items. */
int previous_modification_count = this->modifications;
/* Push the root table as instance object, this is what squirrel does for meta-functions. */
sq_pushroottable(vm);
/* Push all arguments for the valuator function. */
- sq_pushinteger(vm, key);
+ sq_pushinteger(vm, (*iter).first);
for (int i = 0; i < nparam - 1; i++) {
sq_push(vm, i + 3);
}
@@ -870,7 +868,7 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
return sq_throwerror(vm, _SC("modifying valuated list outside of valuator function"));
}
- this->SetValue(key, value);
+ this->SetValue((*iter).first, value);
/* Pop the return value. */
sq_poptop(vm);