From bbc4447ab65140d5657cb5c320c8bd86fc3f1618 Mon Sep 17 00:00:00 2001 From: ChrisL Date: Wed, 2 Apr 2008 21:34:11 +0000 Subject: [PATCH] Fixed a bug that would cause a freeze while in OldInv mode at the very start of the game if you didn't open the tactical inventory panel before trying to open the strategic inventory panel. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1977 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/mapscreen.cpp | 3 ++- Tactical/Interface Items.cpp | 12 ++++++++++-- Tactical/Interface Items.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 38793303..6d5f0402 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -7629,13 +7629,14 @@ void BltCharInvPanel() { InitializeInvPanelCoordsNew(); // This function sets the mouse regions for the soldier inventory - InitInventorySoldier(gMapScreenInvPocketXY, MAPInvMoveCallback, MAPInvClickCallback, FALSE); + InitInventorySoldier(gMapScreenInvPocketXY, MAPInvMoveCallback, MAPInvClickCallback, FALSE, TRUE); fResetMapCoords=FALSE; } disOpt = 1; } else { + InitInventorySoldier(gMapScreenInvPocketXY, MAPInvMoveCallback, MAPInvClickCallback, FALSE, FALSE); //InitializeInvPanelCoordsOld(); } Blt8BPPDataTo16BPPBufferTransparent( pDestBuf, uiDestPitchBYTES, hCharListHandle, PLAYER_INFO_X, PLAYER_INFO_Y, disOpt); diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index f260acd9..0785257c 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -1039,9 +1039,17 @@ void InitInventoryVehicle(INV_REGION_DESC *pRegionDesc, MOUSE_CALLBACK INVMoveCa } } // CHRISL: Function to recreate inventory mouse regions -void InitInventorySoldier(INV_REGION_DESC *pRegionDesc, MOUSE_CALLBACK INVMoveCallback, MOUSE_CALLBACK INVClickCallback, BOOLEAN fSetHighestPrioity) +void InitInventorySoldier(INV_REGION_DESC *pRegionDesc, MOUSE_CALLBACK INVMoveCallback, MOUSE_CALLBACK INVClickCallback, BOOLEAN fSetHighestPrioity, BOOLEAN fNIVmode) { - InitInventoryNew(); + if(fNIVmode == TRUE) + InitInventoryNew(); + else + { + if(gSMInvData[0].sHeight == 0 && gSMInvData[0].sWidth == 0) //base values havn't been set yet + InitInventoryOld(); + else + return; + } for(int cnt=INV_START_POS; cnt