diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 337ebbbd..5017ae37 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -18466,7 +18466,11 @@ void HandleSystemNewAISituation( SOLDIERTYPE *pSoldier, BOOLEAN fResetABC ) if ( pSoldier->aiData.bNewSituation == IS_NEW_SITUATION ) { // Cancel what they were doing.... - pSoldier->usPendingAnimation = NO_PENDING_ANIMATION; + // silversurfer: bugfix for endless dying mercs on roof edges + // if we delete their pending animation here they will just turn into the proper direction for the fall (in TurnSoldier( void ) ) + // and stand there forever afterwards in "dying" state, so let this guy fall off the roof first! + if ( !pSoldier->usPendingAnimation == FALLOFF && !pSoldier->usPendingAnimation == FALLFORWARD_ROOF ) + pSoldier->usPendingAnimation = NO_PENDING_ANIMATION; pSoldier->usPendingAnimation2 = NO_PENDING_ANIMATION; pSoldier->flags.bTurningFromPronePosition = FALSE; pSoldier->ubPendingDirection = NO_PENDING_DIRECTION; diff --git a/TacticalAI/Attacks.cpp b/TacticalAI/Attacks.cpp index f9d9c93c..c6aa16d8 100644 --- a/TacticalAI/Attacks.cpp +++ b/TacticalAI/Attacks.cpp @@ -22,6 +22,7 @@ #include "lighting.h" #include "Sound Control.h" #include "message.h" +#include "Vehicles.h" #endif extern INT16 DirIncrementer[8]; @@ -206,6 +207,9 @@ void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN shootUns continue; // next opponent } + // silversurfer: ignore empty vehicles + if ( pOpponent->ubWhatKindOfMercAmI == MERC_TYPE__VEHICLE && GetNumberInVehicle( pOpponent->bVehicleID ) == 0 ) + continue; // Special stuff for Carmen the bounty hunter if (pSoldier->aiData.bAttitude == ATTACKSLAYONLY && pOpponent->ubProfile != SLAY) @@ -791,6 +795,10 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow) continue; // next soldier } + // silversurfer: ignore empty vehicles + if ( pOpponent->ubWhatKindOfMercAmI == MERC_TYPE__VEHICLE && GetNumberInVehicle( pOpponent->bVehicleID ) == 0 ) + continue; + // Special stuff for Carmen the bounty hunter if (pSoldier->aiData.bAttitude == ATTACKSLAYONLY && pOpponent->ubProfile != SLAY) { @@ -1364,6 +1372,10 @@ void CalcBestStab(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab, BOOLEAN fBladeAt if (pSoldier->pathing.bLevel != pOpponent->pathing.bLevel) continue; // next merc + // silversurfer: ignore empty vehicles + if ( pOpponent->ubWhatKindOfMercAmI == MERC_TYPE__VEHICLE && GetNumberInVehicle( pOpponent->bVehicleID ) == 0 ) + continue; + // Special stuff for Carmen the bounty hunter if (pSoldier->aiData.bAttitude == ATTACKSLAYONLY && pOpponent->ubProfile != SLAY) continue; // next opponent