From 61c5a41beaefe38cbcbd16ec6788f9777b1c7683 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sun, 17 Nov 2024 01:35:49 +0200 Subject: [PATCH] LocateSoldier() & HandleMercLeavingEquipmentInDrassen() & HandleMercLeavingEquipmentInOmerta() --- Strategic/Map Screen Interface.cpp | 18 +++++++++--------- Strategic/Map Screen Interface.h | 6 +++--- Tactical/Overhead.cpp | 4 ++-- Tactical/Overhead.h | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Strategic/Map Screen Interface.cpp b/Strategic/Map Screen Interface.cpp index eadc70bb8..d23f06c17 100644 --- a/Strategic/Map Screen Interface.cpp +++ b/Strategic/Map Screen Interface.cpp @@ -1625,7 +1625,7 @@ void HandleLeavingOfEquipmentInCurrentSector( SoldierID uiMercId ) -void HandleMercLeavingEquipmentInOmerta( UINT32 uiMercId ) +void HandleMercLeavingEquipmentInOmerta( SoldierID uiMercId ) { INT32 iSlotIndex = 0; @@ -1643,7 +1643,7 @@ void HandleMercLeavingEquipmentInOmerta( UINT32 uiMercId ) } -void HandleMercLeavingEquipmentInDrassen( UINT32 uiMercId ) +void HandleMercLeavingEquipmentInDrassen( SoldierID uiMercId ) { INT32 iSlotIndex = 0; @@ -1856,7 +1856,7 @@ INT32 FindFreeSlotInLeaveList( void ) } -INT32 SetUpDropItemListForMerc( UINT32 uiMercId ) +INT32 SetUpDropItemListForMerc( SoldierID uiMercId ) { // will set up a drop list for this grunt, remove items from inventory, and profile INT32 iSlotIndex = -1; @@ -1867,27 +1867,27 @@ INT32 SetUpDropItemListForMerc( UINT32 uiMercId ) return( -1 ); } - UINT32 invsize = Menptr[ uiMercId ].inv.size(); + UINT32 invsize = uiMercId->inv.size(); for( UINT32 iCounter = 0; iCounter < invsize; ++iCounter ) { // slot found, // check if actual item - if( Menptr[ uiMercId ].inv[ iCounter ].exists() == true ) + if( uiMercId->inv[ iCounter ].exists() == true ) { // make a linked list of the items left behind, with the ptr to its head in this free slot - AddItemToLeaveIndex( &( Menptr[ uiMercId ].inv[ iCounter ] ), iSlotIndex ); + AddItemToLeaveIndex( &( uiMercId->inv[ iCounter ] ), iSlotIndex ); // store owner's profile id for the items added to this leave slot index - SetUpMercAboutToLeaveEquipment( Menptr[ uiMercId ].ubProfile, iSlotIndex ); + SetUpMercAboutToLeaveEquipment( uiMercId->ubProfile, iSlotIndex ); } } // ATE: Added this to drop keyring keys - the 2nd last paramter says to add it to a leave list... // the gridno, level and visiblity are ignored - DropKeysInKeyRing( MercPtrs[ uiMercId ], NOWHERE, 0, 0, TRUE, iSlotIndex, FALSE ); + DropKeysInKeyRing( uiMercId, NOWHERE, 0, 0, TRUE, iSlotIndex, FALSE ); // zero out profiles - gMercProfiles[ Menptr[ uiMercId ].ubProfile ].clearInventory(); + gMercProfiles[ uiMercId->ubProfile ].clearInventory(); return( iSlotIndex ); } diff --git a/Strategic/Map Screen Interface.h b/Strategic/Map Screen Interface.h index d29fb861c..0120c7d04 100644 --- a/Strategic/Map Screen Interface.h +++ b/Strategic/Map Screen Interface.h @@ -516,8 +516,8 @@ void GetMoraleString( SOLDIERTYPE *pSoldier, STR16 sString ); void HandleLeavingOfEquipmentInCurrentSector( SoldierID uiMercId ); // set up a linked list of items being dropped and post an event to later drop them -void HandleMercLeavingEquipmentInDrassen( UINT32 uiMercId ); -void HandleMercLeavingEquipmentInOmerta( UINT32 uiMercId ); +void HandleMercLeavingEquipmentInDrassen( SoldierID uiMercId ); +void HandleMercLeavingEquipmentInOmerta( SoldierID uiMercId ); // actually drop the stored list of items void HandleEquipmentLeftInOmerta( UINT32 uiSlotIndex ); @@ -537,7 +537,7 @@ void FreeLeaveListSlot( UINT32 uiSlotIndex ); INT32 FindFreeSlotInLeaveList( void ); // set up drop list -INT32 SetUpDropItemListForMerc( UINT32 uiMercId ); +INT32 SetUpDropItemListForMerc( SoldierID uiMercId ); // store owner's profile id for the items added to this leave slot index void SetUpMercAboutToLeaveEquipment( UINT32 ubProfileId, UINT32 uiSlotIndex ); diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index c4e2164e8..3676eeb78 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -3488,7 +3488,7 @@ BOOLEAN ResetAllAnimationCache( ) -void LocateSoldier( UINT16 usID, BOOLEAN fSetLocator) +void LocateSoldier( SoldierID usID, BOOLEAN fSetLocator) { SOLDIERTYPE *pSoldier; INT16 sNewCenterWorldX, sNewCenterWorldY; @@ -3501,7 +3501,7 @@ void LocateSoldier( UINT16 usID, BOOLEAN fSetLocator) if (!SoldierOnScreen(usID) || fSetLocator == 10 ) { // Get pointer of soldier - pSoldier = MercPtrs[ usID ]; + pSoldier = usID; // Center on guy sNewCenterWorldX = (INT16)pSoldier->dXPos; diff --git a/Tactical/Overhead.h b/Tactical/Overhead.h index 5ed891e3c..11e0dc00e 100644 --- a/Tactical/Overhead.h +++ b/Tactical/Overhead.h @@ -231,7 +231,7 @@ void SelectSoldier( UINT16 usSoldierID, BOOLEAN fAcknowledge, BOOLEAN fForceRese void RevealAllDroppedEnemyItems(); void LocateGridNo( INT32 sGridNo ); -void LocateSoldier( UINT16 usID, BOOLEAN fSetLocator); +void LocateSoldier( SoldierID usID, BOOLEAN fSetLocator); void BeginTeamTurn( UINT8 ubTeam ); void SlideTo(INT32 sGridNo, UINT16 usSoldierID , UINT16 usReasonID, BOOLEAN fSetLocator) ;