Remove useless code

!AimingGun(pSoldier) would always evaluate to true and there are no hits to CrowDecideAction in the entire solution even in commented out code
This commit is contained in:
Asdow
2023-08-18 21:05:11 +03:00
parent 1c4929c3e1
commit 613de1b869
3 changed files with 3 additions and 9 deletions
-2
View File
@@ -190,7 +190,6 @@ typedef enum
INT16 AdvanceToFiringRange( SOLDIERTYPE * pSoldier, INT16 sClosestOpponent ); INT16 AdvanceToFiringRange( SOLDIERTYPE * pSoldier, INT16 sClosestOpponent );
BOOLEAN AimingGun(SOLDIERTYPE *pSoldier);
void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot); void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot);
void CalcBestStab(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab, BOOLEAN fBladeAttack); void CalcBestStab(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab, BOOLEAN fBladeAttack);
void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow); void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow);
@@ -223,7 +222,6 @@ INT8 ArmedVehicleDecideAction( SOLDIERTYPE* pSoldier );
// a variant of ClosestSeenOpponent(...), that allows to find enemies on a roof // a variant of ClosestSeenOpponent(...), that allows to find enemies on a roof
INT32 ClosestSeenOpponentWithRoof(SOLDIERTYPE *pSoldier, INT32 * psGridNo, INT8 * pbLevel); INT32 ClosestSeenOpponentWithRoof(SOLDIERTYPE *pSoldier, INT32 * psGridNo, INT8 * pbLevel);
INT8 CrowDecideAction( SOLDIERTYPE * pSoldier );
void DecideAlertStatus( SOLDIERTYPE *pSoldier ); void DecideAlertStatus( SOLDIERTYPE *pSoldier );
INT8 DecideAutoBandage( SOLDIERTYPE * pSoldier ); INT8 DecideAutoBandage( SOLDIERTYPE * pSoldier );
UINT16 DetermineMovementMode( SOLDIERTYPE * pSoldier, INT8 bAction ); UINT16 DetermineMovementMode( SOLDIERTYPE * pSoldier, INT8 bAction );
-4
View File
@@ -408,10 +408,6 @@ BOOLEAN InitAI( void )
return( TRUE ); return( TRUE );
} }
BOOLEAN AimingGun(SOLDIERTYPE *pSoldier)
{
return(FALSE);
}
void HandleSoldierAI( SOLDIERTYPE *pSoldier ) // FIXME - this function is named inappropriately void HandleSoldierAI( SOLDIERTYPE *pSoldier ) // FIXME - this function is named inappropriately
{ {
+3 -3
View File
@@ -7086,7 +7086,7 @@ L_NEWAIM:
{ {
// we might want to turn before lying down! // we might want to turn before lying down!
if ( (!gfTurnBasedAI || GetAPsToLook( pSoldier ) <= pSoldier->bActionPoints - GetAPsToChangeStance( pSoldier, (INT8) pSoldier->aiData.usActionData )) && if ( (!gfTurnBasedAI || GetAPsToLook( pSoldier ) <= pSoldier->bActionPoints - GetAPsToChangeStance( pSoldier, (INT8) pSoldier->aiData.usActionData )) &&
(((pSoldier->aiData.bAIMorale > MORALE_HOPELESS) || ubCanMove) && !AimingGun(pSoldier)) ) ((pSoldier->aiData.bAIMorale > MORALE_HOPELESS) || ubCanMove) )
{ {
// if we have a closest seen opponent // if we have a closest seen opponent
if (!TileIsOutOfBounds(sClosestOpponent)) if (!TileIsOutOfBounds(sClosestOpponent))
@@ -7140,7 +7140,7 @@ L_NEWAIM:
// hopeless guys shouldn't waste their time this way, UNLESS they CAN move // hopeless guys shouldn't waste their time this way, UNLESS they CAN move
// but chose not to to get this far (which probably means they're cornered) // but chose not to to get this far (which probably means they're cornered)
// ALSO, don't bother turning if we're already aiming a gun // ALSO, don't bother turning if we're already aiming a gun
if ( !gfHiddenInterrupt && ((pSoldier->aiData.bAIMorale > MORALE_HOPELESS) || ubCanMove) && !AimingGun(pSoldier)) if ( !gfHiddenInterrupt && ((pSoldier->aiData.bAIMorale > MORALE_HOPELESS) || ubCanMove) )
{ {
// determine the location of the known closest opponent // determine the location of the known closest opponent
// (don't care if he's conscious, don't care if he's reachable at all) // (don't care if he's conscious, don't care if he's reachable at all)
@@ -10297,7 +10297,7 @@ INT8 ArmedVehicleDecideActionBlack( SOLDIERTYPE *pSoldier )
// hopeless guys shouldn't waste their time this way, UNLESS they CAN move // hopeless guys shouldn't waste their time this way, UNLESS they CAN move
// but chose not to to get this far (which probably means they're cornered) // but chose not to to get this far (which probably means they're cornered)
// ALSO, don't bother turning if we're already aiming a gun // ALSO, don't bother turning if we're already aiming a gun
if ( !gfHiddenInterrupt && ((pSoldier->aiData.bAIMorale > MORALE_HOPELESS) || ubCanMove) && !AimingGun( pSoldier ) ) if ( !gfHiddenInterrupt && ((pSoldier->aiData.bAIMorale > MORALE_HOPELESS) || ubCanMove) )
{ {
// determine the location of the known closest opponent // determine the location of the known closest opponent
// (don't care if he's conscious, don't care if he's reachable at all) // (don't care if he's conscious, don't care if he's reachable at all)