(svn r26790) [1.4] -Backport from trunk:

- Fix: Loading a game with order backups leaked Orders and left unreachable items in the pool (r26787)
- Fix: Buffer overrun in SQCompiler::Error (r26764)
- Fix: Desync due to not always properly restoring game state from the savegame (r26753)
- Fix: [Script] Crashes and infinite loops when using lists in item-descending order [FS#6085] (r26744)
This commit is contained in:
frosch
2014-09-07 15:09:05 +00:00
committed by Sergii Pylypenko
parent 8e7eedf593
commit 6a30fa67b9
5 changed files with 17 additions and 6 deletions

View File

@@ -354,7 +354,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;
}