From 75deccbc44d08a74122241dcfecc10f5e739654d Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:56:26 +0200 Subject: [PATCH] Convert SOLDIERTYPE::ubRobotRemoteHolderID to SoldierID --- Strategic/Auto Resolve.cpp | 2 +- Tactical/Dialogue Control.cpp | 2 +- Tactical/Soldier Control.cpp | 6 ++---- Tactical/Soldier Control.h | 2 +- Tactical/TeamTurns.cpp | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index 2d833ef6..6613354a 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -2835,7 +2835,7 @@ void RetreatButtonCallback( GUI_BUTTON *btn, INT32 reason ) if( gpAR->pRobotCell ) { //if robot is retreating, set the retreat time to be the same as the robot's controller. - UINT16 ubRobotControllerID; + SoldierID ubRobotControllerID; ubRobotControllerID = gpAR->pRobotCell->pSoldier->ubRobotRemoteHolderID; diff --git a/Tactical/Dialogue Control.cpp b/Tactical/Dialogue Control.cpp index 4a2fc253..52d13596 100644 --- a/Tactical/Dialogue Control.cpp +++ b/Tactical/Dialogue Control.cpp @@ -1595,7 +1595,7 @@ BOOLEAN TacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNum ) { if ( pSoldier->CanRobotBeControlled( ) ) { - return( TacticalCharacterDialogue( MercPtrs[ pSoldier->ubRobotRemoteHolderID ], usQuoteNum ) ); + return( TacticalCharacterDialogue( pSoldier->ubRobotRemoteHolderID, usQuoteNum ) ); } else { diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index fbd3f15d..35aeea8c 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -23549,8 +23549,6 @@ BOOLEAN SOLDIERTYPE::IsValidPistolFastShot( INT16 bAimTime, INT32 iTrgGridNo ) } BOOLEAN SOLDIERTYPE::CanRobotBeControlled( void ) { - SOLDIERTYPE *pController; - if ( !(this->flags.uiStatusFlags & SOLDIER_ROBOT) ) { return(FALSE); @@ -23561,7 +23559,7 @@ BOOLEAN SOLDIERTYPE::CanRobotBeControlled( void ) return(FALSE); } - pController = MercPtrs[this->ubRobotRemoteHolderID]; + SOLDIERTYPE* pController = this->ubRobotRemoteHolderID; if ( pController->bActive ) { @@ -23665,7 +23663,7 @@ SOLDIERTYPE *SOLDIERTYPE::GetRobotController( void ) } else { - return(MercPtrs[this->ubRobotRemoteHolderID]); + return(this->ubRobotRemoteHolderID); } } diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 34f9a777..51193c3a 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -1428,7 +1428,7 @@ public: INT32 iBurstSoundID; INT8 bSlotItemTakenFrom; UINT16 ubAutoBandagingMedic; - UINT16 ubRobotRemoteHolderID; + SoldierID ubRobotRemoteHolderID; UINT32 uiTimeOfLastContractUpdate; INT8 bTypeOfLastContract; INT8 bTurnsCollapsed; diff --git a/Tactical/TeamTurns.cpp b/Tactical/TeamTurns.cpp index d3962619..0bc3e181 100644 --- a/Tactical/TeamTurns.cpp +++ b/Tactical/TeamTurns.cpp @@ -1825,8 +1825,8 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT16 ubOpponentID, BOOLEAN { //iPoints = EffectiveExpLevel( MercPtrs[ pSoldier->ubRobotRemoteHolderID ] ) - 2; // Snap: (do some proper rounding here) - iPoints = ( 20*EffectiveExpLevel( MercPtrs[ pSoldier->ubRobotRemoteHolderID ] ) - + EffectiveAgility( MercPtrs[ pSoldier->ubRobotRemoteHolderID ], FALSE ) + 15 ) / 30 - 2; + iPoints = ( 20*EffectiveExpLevel( pSoldier->ubRobotRemoteHolderID ) + + EffectiveAgility( pSoldier->ubRobotRemoteHolderID, FALSE ) + 15 ) / 30 - 2; } else {