Changeset - r21612:0b64a185f3a1
[Not reviewed]
master
0 1 0
frosch - 10 years ago 2014-08-16 21:13:58
frosch@openttd.org
(svn r26744) -Fix [FS6085-ish]: ScriptListSorterItemDescending::FindNext failed to detect the end.
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_list.cpp
Show inline comments
 
@@ -359,13 +359,18 @@ public:
 
	void FindNext()
 
	{
 
		if (this->item_iter == this->list->items.end()) {
 
			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;
 
	}
 

	
 
	int32 Next()
 
	{
 
		if (this->IsEnd()) return 0;
0 comments (0 inline, 0 general)