summaryrefslogtreecommitdiff
path: root/src/script/api
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-08-16 21:13:58 +0000
committerfrosch <frosch@openttd.org>2014-08-16 21:13:58 +0000
commit7ca57bc578277acb13f28e50c25ec3fab9c07fb8 (patch)
tree3ad3d176fa6d4a3b8a862c85dce7a31e851ca0cb /src/script/api
parenta03ad12322e2e79ef423fe2d1737a3331e33afad (diff)
downloadopenttd-7ca57bc578277acb13f28e50c25ec3fab9c07fb8.tar.xz
(svn r26744) -Fix [FS6085-ish]: ScriptListSorterItemDescending::FindNext failed to detect the end.
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/script_list.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/script/api/script_list.cpp b/src/script/api/script_list.cpp
index 84f2b937c..a185e0d89 100644
--- a/src/script/api/script_list.cpp
+++ b/src/script/api/script_list.cpp
@@ -362,7 +362,12 @@ public:
this->has_no_more_items = true;
return;
}
- this->item_iter--;
+ if (this->item_iter == this->list->items.begin()) {
+ /* Use 'end' as marker for 'beyond begin' */
+ this->item_iter = this->list->items.end();
+ } else {
+ this->item_iter--;
+ }
if (this->item_iter != this->list->items.end()) item_next = (*this->item_iter).first;
}