diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-27 02:53:01 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-27 02:53:01 -0800 |
commit | 2c9120bf3ebf1482ea20ab96008579570453342b (patch) | |
tree | 51db3ebe13f36661686e6b924ef41269e0e79860 /crawl-ref/source/shopping.cc | |
parent | 2579ebdc853d91e78e58e65c134eff1a18d738e2 (diff) | |
download | crawl-ref-2c9120bf3ebf1482ea20ab96008579570453342b.tar.gz crawl-ref-2c9120bf3ebf1482ea20ab96008579570453342b.zip |
Bug #74: fix shopping list crash
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r-- | crawl-ref/source/shopping.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 74b15d0ed7..b42432c843 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -2405,12 +2405,15 @@ void ShoppingList::move_things(const coord_def &_src, const coord_def &_dst) void ShoppingList::forget_pos(const level_pos &pos) { - for (unsigned int i = (list->size() - 1); i>= 0; i--) + for (unsigned int i = 0; i < list->size(); i++) { const CrawlHashTable &thing = (*list)[i]; if (thing_pos(thing) == pos) + { list->erase(i); + i--; + } } } |