Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(gameengine): let a contact weapon go off against building geometry
Olcay Seygan0c4f4d79a3b2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7912c6fa6..afea61424 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -285,6 +285,7 @@ found and fixed — EA's own, not port damage.**- A sniper cannot pick at an empty Stinger Site. The rule that stops snipers hurting empty buildings only counted passengers, and a Stinger Site's men are spawned, not carried.- A booby trap shot off a building, or sold with it, releases the building. The mark was only ever cleared when the trap went off, so the building stayed marked for the rest of the match and no second trap could be laid.- Something flagged unselectable is unselectable. The flag existed and nothing read it.+- A suicide unit pressed up against a building goes off. Touching the building's outline counted as having its view blocked, so it walked away to find a clear line of sight it never needed, came back, and did it again without ever detonating.- Cancelling an order of Red Guard after the first soldier has walked out no longer refunds the order. One order is two soldiers for one price, and the refund came back whole, so the first one was free.- Double-clicking to grab everything of a kind grabs what a box would, not things you can only click one at a time.- A bounty pays what the percentage says. Rounding up a fraction that was already a whole number paid a dollar extra on every kill.diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cppindex 19a6431f8..f06440b07 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp@@ -11302,6 +11302,11 @@ Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coo}if (w){+ // A contact weapon needs no line of sight: a suicide bomber pressed against a building's+ // geometry was told its view was blocked, went looking for a clear spot, and never went off.+ if (w->isContactWeapon())+ return false;+Bool viewBlocked;if (victim)viewBlocked = !w->isClearGoalFiringLineOfSightTerrain(attacker, attackerPos, victim);diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cppindex fa891506f..f5cf88ab2 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp@@ -5140,7 +5140,8 @@ 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 probbaly have to find another way to fix this mine-clearing bug. (srj)- if (weapon && weapon->isContactWeapon() && !isPathAvailable(&localPos))+ // Already in range means there is nothing to walk to: the weapon goes off where it stands.+ if (weapon && weapon->isContactWeapon() && !weapon->isWithinAttackRange(getObject(), &localPos) && !isPathAvailable(&localPos)){FindPositionOptions fpOptions;fpOptions.minRadius = 0.0f;