From a10e216c5f80e2eeb91d27ce2b11a6ed9d61461f Mon Sep 17 00:00:00 2001 From: Wanne Date: Sun, 13 Jan 2013 17:48:12 +0000 Subject: [PATCH] Fixes (by Buggler) - fixed autoplace object getting lost from merc inventory to sector when another sector shown (CTRL+LMB) - fixed LBE autoplace from merc inventory - fixed CTRL/CTRL+SHIFT behavior when autoplace from merc inv ** Autoplace objects to & from between merc inv & map sector should work proper now (even in another sector inventory) - fixed missing balance & amount during money withdrawal in vanilla classic git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5781 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/mapscreen.cpp | 29 ++++++++++++++--------------- Tactical/Interface Items.cpp | 10 ++++++++-- Tactical/Items.cpp | 8 +++++--- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 2b211e84e..651409938 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -6811,7 +6811,6 @@ void InitializeWorldSize(INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ) void GetMapKeyboardInput( UINT32 *puiNewEvent ) { InputAtom InputEvent; - POINT MousePos; INT8 bSquadNumber; UINT8 ubGroupId = 0; BOOLEAN fCtrl, fAlt; @@ -9489,19 +9488,6 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason ) return; } - if ( _KeyDown(CTRL) ) - { - //CleanUpStack( &( pSoldier->inv[ uiHandPos ] ), NULL ); - - if( AutoPlaceObjectToWorld(pSoldier, &( pSoldier->inv[ uiHandPos ] ) ) ) - { - //INVRenderINVPanelItem( pSoldier, uiHandPos, DIRTYLEVEL2); // redraw the empty slot - - fTeamPanelDirty = TRUE; - RenderTeamRegionBackground(); - } - } - /* CHRISL: For New Inventory system. Are we removing an existing LBE item? If so, we need to pull all items in the relevant IC Group pockets out of the soldiers inventory and put them into the LBE items inventory. But first, find out if we already have a LBE item inventory for this item and this merc. If we @@ -9538,7 +9524,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason ) HandleTacticalEffectsOfEquipmentChange( pSoldier, uiHandPos, usOldItemIndex, NOTHING ); - fInterfacePanelDirty = DIRTYLEVEL2; + fInterfacePanelDirty = DIRTYLEVEL2; fCharacterInfoPanelDirty = TRUE; } else // item in cursor @@ -9851,6 +9837,19 @@ void MAPBeginItemPointer( SOLDIERTYPE *pSoldier, UINT8 ubHandPos ) numToMove = 1; } pSoldier->inv[ubHandPos].MoveThisObjectTo(gItemPointer, numToMove, pSoldier, ubHandPos); + + //Autoplace to map sector invectory + if ( _KeyDown(CTRL) ) + { + if( AutoPlaceObjectToWorld(pSoldier, &gItemPointer) ) + { + //INVRenderINVPanelItem( pSoldier, uiHandPos, DIRTYLEVEL2); // redraw the empty slot + + fTeamPanelDirty = TRUE; + RenderTeamRegionBackground(); + } + return; + } if ( gItemPointer.exists() == false ) { diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index ce70d8003..daa94de97 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -7281,7 +7281,10 @@ void RenderItemDescriptionBox( ) swprintf( pStr, L"%ld", gRemoveMoney.uiMoneyRemaining ); InsertCommasForDollarFigure( pStr ); InsertDollarSignInToString( pStr ); - FindFontRightCoordinates( gMoneyStats[ 4 ].sX + 50, gMoneyStats[ 4 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); + if (UsingNewInventorySystem() == true) + FindFontRightCoordinates( gMoneyStats[ 4 ].sX + 50, gMoneyStats[ 4 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); + else + FindFontRightCoordinates( gMoneyStats[ 4 ].sX + 5, gMoneyStats[ 4 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); //Display the total amount of money removing @@ -7289,7 +7292,10 @@ void RenderItemDescriptionBox( ) swprintf( pStr, L"%ld", gRemoveMoney.uiMoneyRemoving ); InsertCommasForDollarFigure( pStr ); InsertDollarSignInToString( pStr ); - FindFontRightCoordinates( gMoneyStats[ 5 ].sX + 50, gMoneyStats[ 5 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); + if (UsingNewInventorySystem() == true) + FindFontRightCoordinates( gMoneyStats[ 5 ].sX + 50, gMoneyStats[ 5 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); + else + FindFontRightCoordinates( gMoneyStats[ 5 ].sX + 5, gMoneyStats[ 5 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); mprintf( usX, usY, pStr ); } else diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index b11a348cd..80ac185e2 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -6775,10 +6775,12 @@ BOOLEAN AutoPlaceObjectToWorld(SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, INT8 b } // WANNE: This should fix the bug, that items get lost in the sector when switching between tactical sectors - // This bug was introduced in revision 4571 (2011-07-14) + // This bug was introduced in revision 4571 (2011-07-14), fixed in 5228 + // Buggler: Previously item get lost when holding CTRL & clicking on item in merc inventory when map screen shows other sectors + // Fixed above issue on commit in 5781 (2013-01-13). Please remove all comments if no reported issue after adequate public testing - //if(!fShowMapInventoryPool) - if(fShowMapInventoryPool) + if(!fShowMapInventoryPool) + //if(fShowMapInventoryPool) // Buggler: to remove too { fShowMapInventoryPool = TRUE; CreateDestroyMapInventoryPoolButtons(FALSE);