From b8e5ebcf6cfe4a12405418949bf130527e6a453e Mon Sep 17 00:00:00 2001 From: ChrisL Date: Tue, 7 Jun 2011 18:16:56 +0000 Subject: [PATCH] BUGFIX 514 - A vector error in the size of the world inventory was causing a mouse button to be deleted twice resulting in an assertion error. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4485 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/mapscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 0e63c8a86..86866ce31 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -1020,7 +1020,7 @@ void BeginSellAllCallBack( UINT8 bExitValue ) { return; } - for(UINT32 wItem = 0; wItem < guiNumWorldItems; wItem++) //WS TODO: is "for(UINT32 wItem = 0; wItem < pInventoryPoolList.size(); wItem++)" better? It resolved a bug in the old SVN, but things have changed now. (It was likely only fighting symptons anyway) + for(UINT32 wItem = 0; wItem < pInventoryPoolList.size(); wItem++) //CHRISL: It's safer to use pInventoryPoolList.size() versus guiNumWorldItems as it avoids any possibility of a vector size error { if(pInventoryPoolList[wItem].object.exists() == true && (pInventoryPoolList[wItem].usFlags & WORLD_ITEM_REACHABLE)) {