diff options
author | truebrain <truebrain@openttd.org> | 2011-12-21 12:25:10 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-21 12:25:10 +0000 |
commit | da8777d4e590f2c4414453d88c306c57f964326d (patch) | |
tree | 262247e7c77001d5bd49d3b799c1776f7b7b2c23 /src/script | |
parent | 0f8360eee9b43a1ff4be7e86d2e92cb3240d62ae (diff) | |
download | openttd-da8777d4e590f2c4414453d88c306c57f964326d.tar.xz |
(svn r23646) -Fix [FS#4901]: rescan the Game Scripts when done downloading one.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/script_list.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/script/api/script_list.cpp b/src/script/api/script_list.cpp index 14d400bcb..f6f2f4596 100644 --- a/src/script/api/script_list.cpp +++ b/src/script/api/script_list.cpp @@ -818,13 +818,15 @@ 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, (*iter).first); + sq_pushinteger(vm, key); for (int i = 0; i < nparam - 1; i++) { sq_push(vm, i + 3); } @@ -868,7 +870,7 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm) return sq_throwerror(vm, _SC("modifying valuated list outside of valuator function")); } - this->SetValue((*iter).first, value); + this->SetValue(key, value); /* Pop the return value. */ sq_poptop(vm); |