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
This commit is contained in:
Shadooow
2021-05-24 05:26:14 +00:00
parent 0cddd33264
commit 5f62e90189
+5 -5
View File
@@ -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);