From 5f62e901891b78125deadeb8e351811186beb002 Mon Sep 17 00:00:00 2001 From: Shadooow Date: Mon, 24 May 2021 05:26:14 +0000 Subject: [PATCH] replaced iLastHandPosMapScreen global from mapscreen inventory code with iLastHandPos from tactical - I need it for upcoming feature and it should not cause any problems since you cannot have item in mouse pointer and change game mode git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9043 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/mapscreen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index e6ef4e2c5..024705c7c 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -585,7 +585,7 @@ extern UINT8 gubHandPos; extern UINT16 gusOldItemIndex; extern UINT16 gusNewItemIndex; extern BOOLEAN gfDeductPoints; -INT32 iLastHandPosMapScreen = -1; +extern INT32 iLastHandPos; extern void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj ); extern void SwapGoggles(SOLDIERTYPE *pTeamSoldier); @@ -9708,7 +9708,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason ) // remember what it was usOldItemIndex = pSoldier->inv[ uiHandPos ].usItem; - iLastHandPosMapScreen = uiHandPos; + iLastHandPos = uiHandPos; // pick it up MAPBeginItemPointer( pSoldier, (UINT8)uiHandPos ); @@ -9735,12 +9735,12 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason ) return; //Jenilee: determine the cost of moving this item around in our inventory - usCostToMoveItem = GetInvMovementCost(gpItemPointer, iLastHandPosMapScreen, uiHandPos); + usCostToMoveItem = GetInvMovementCost(gpItemPointer, iLastHandPos, uiHandPos); // Flugente: backgrounds usCostToMoveItem = (usCostToMoveItem * (100 + pSoldier->GetBackgroundValue(BG_INVENTORY))) / 100; //we dont have enough APs to move it to this slot, show a warning message - if (usCostToMoveItem > 0 && pSoldier->bActionPoints < usCostToMoveItem && pSoldier->inv[iLastHandPosMapScreen].usItem == NULL) + if (usCostToMoveItem > 0 && pSoldier->bActionPoints < usCostToMoveItem && pSoldier->inv[iLastHandPos].usItem == NULL) { ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[NOT_ENOUGH_APS_STR]); return; @@ -9877,7 +9877,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason ) // Else, try to place here if (PlaceObject(pSoldier, (UINT8)uiHandPos, gpItemPointer)) { - iLastHandPosMapScreen = uiHandPos; + iLastHandPos = uiHandPos; pSoldier->bActionPoints -= usCostToMoveItem; HandleTacticalEffectsOfEquipmentChange(pSoldier, uiHandPos, usOldItemIndex, usNewItemIndex);