diff --git a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 4377e6d2105..2922b327f27 100644 --- a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -9576,6 +9576,11 @@ Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coo } if (w) { +#if !RETAIL_COMPATIBLE_CRC + if (w->isContactWeapon()) + return false; +#endif + Bool viewBlocked; if (victim) viewBlocked = !w->isClearGoalFiringLineOfSightTerrain(attacker, attackerPos, victim); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index c49ae77d861..ceaa3fd6ddc 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3399,7 +3399,11 @@ void AIUpdateInterface::privateAttackPosition( const Coord3D *pos, Int maxShotsT // this fixes an obscure bug with mine-clearing: if you tell someone to clear mines and put the centerpoint // inside a building, the dozer/worker will just go thru the building to that spot. ick. so if you find that // this clause (below) is problematic, you'll probably have to find another way to fix this mine-clearing bug. (srj) +#if RETAIL_COMPATIBLE_CRC if (weapon && weapon->isContactWeapon() && !isPathAvailable(&localPos)) +#else + if (weapon && weapon->isContactWeapon() && !weapon->isWithinAttackRange(getObject(), &localPos) && !isPathAvailable(&localPos)) +#endif { FindPositionOptions fpOptions; fpOptions.minRadius = 0.0f; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 977aec18670..6f9384af00a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3554,7 +3554,11 @@ void AIUpdateInterface::privateAttackPosition( const Coord3D *pos, Int maxShotsT // this fixes an obscure bug with mine-clearing: if you tell someone to clear mines and put the centerpoint // inside a building, the dozer/worker will just go thru the building to that spot. ick. so if you find that // this clause (below) is problematic, you'll probably have to find another way to fix this mine-clearing bug. (srj) +#if RETAIL_COMPATIBLE_CRC if (weapon && weapon->isContactWeapon() && !isPathAvailable(&localPos)) +#else + if (weapon && weapon->isContactWeapon() && !weapon->isWithinAttackRange(getObject(), &localPos) && !isPathAvailable(&localPos)) +#endif { FindPositionOptions fpOptions; fpOptions.minRadius = 0.0f;