From a389081a9a8ce946e03c6e98f10fb9479541b70a Mon Sep 17 00:00:00 2001 From: silversurfer Date: Tue, 24 Sep 2013 20:34:43 +0000 Subject: [PATCH] Bugfix for crash with empty sector inventory (by Moa) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6440 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Map Screen Interface Map Inventory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 9a9913563..753f0b125 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -985,7 +985,11 @@ void SaveSeenAndUnseenItems( void ) } } - //check whether memmory (loaded map) or file is used to save the items + // no items to save but we need an iterator + if ( worldItemsSaveList.size() == 0 ) + worldItemsSaveList.resize(1); + + //check whether memory (loaded map) or file is used to save the items if( ( gWorldSectorX == sSelMapX ) && ( gWorldSectorY == sSelMapY ) && ( gbWorldSectorZ == ( INT8 ) ( iCurrentMapSectorZ ) ) ) { //handle in existing function