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): keep the emp patriot's burst off its own side
Olcay Seygand2c1d7536486
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7ff724bd5..f7e58b502 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -556,6 +556,7 @@ Every Zero Hour general is a copy of a base faction with changes on top, and the- Air Force: a Saboteur in your Supply Center steals money and nothing else. The building was marked as a power plant, so the same Saboteur also blacked out your base.- Air Force and Superweapon: nothing can shoot at the gas cloud an Aurora leaves behind. Enemy defences used to waste their fire on it.- Air Force and Superweapon: the Microwave Tank stops showing a Composite Armor icon for an upgrade those generals cannot buy.+- Superweapon: the EMP Patriot stops knocking out its own side. Every missile leaves an EMP burst where it lands, and since EA's first patch that burst spared only your buildings, so your own and your allies' vehicles under it went dark and any of your aircraft flying beside the target fell out of the sky. Three Comanches hovering on an enemy Helix used to go down with it in the Patriot's first volley; now the Helix goes down alone. An EMP mine's burst leaves allied aircraft and an ally's buildings alone too, which it always meant to. Replays with an EMP Patriot or an EMP mine in them, recorded before this, can play out differently.- American soldiers killed by gamma toxin scream in English. Rangers, Colonel Burton, Missile Defenders, Pathfinders and pilots of the Air Force, Laser and Superweapon generals died with a GLA rebel's voice, and Chinese infantry of the Tank, Infantry and Nuke generals did the same; Black Lotus now dies with a woman's voice.- Laser: a Humvee plays its door sound once. Every soldier getting in or out played it twice.- Laser: the Laser Turret's anti-air and assist shots are its own blue beam with its own sound, not a Laser Paladin's.diff --git a/GeneralsMD/Code/Data/INI/FixesReforged.ini b/GeneralsMD/Code/Data/INI/FixesReforged.iniindex b3e1d36cf..41d0e52f6 100644--- a/GeneralsMD/Code/Data/INI/FixesReforged.ini+++ b/GeneralsMD/Code/Data/INI/FixesReforged.ini@@ -253,6 +253,30 @@ Object SupW_AmericaInfantryPilotEndEnd+; The EMP Patriot's missiles leave this sphere where they burst. Patch 1.01 commented out its+; DoesNotAffect = ALLIES, so it spared only its owner's buildings: its own and allied vehicles in the+; sphere were disabled, and its own and allied aircraft in the sky were killed. The EMP mines' sphere+; kept the line. EMPUpdate now asks it before the aircraft branch.++Object EMPPatriotEffectSpheroid+ ReplaceModule ModuleTag_02+ Behavior = EMPUpdate ModuleTag_02_Fix+ DisabledDuration = 10000+ Lifetime = 500+ StartFadeTime = 100+ StartScale = 0.01+ TargetScaleMin = 2.00+ TargetScaleMax = 3.00+ StartColor = R:0 G:255 B:255+ EndColor = R:0 G:128 B:128+ EffectRadius = 10+ DisableFXParticleSystem = EMPSparks+ DoesNotAffect = ALLIES+ DoesNotAffectMyOwnBuildings = Yes+ End+ End+End+; ==== All three USA generals =====================================================================; The plain Chinook's unload times went from 3000/1250 to 2900/1200, the old values left in its@@ -667,6 +691,117 @@ Object SupW_AmericaVehicleSentryDroneSoundMoveStart = SentryDroneMoveStartEnd+; A Sentry Drone with its gun goes invisible after two seconds parked, and from then on it watched+; enemies drive past without firing a shot. EA left Stealthed commented out of its+; AutoAcquireEnemiesWhenIdle line, and a stealthed unit without it never picks an idle target+; (AIUpdateInterface::getNextMoodTarget); the line's own comment says what the flag was for, and+; the Boss general's drone and the Pathfinder have it. Firing still lifts the stealth+; (StealthForbiddenConditions = FIRING_PRIMARY). The same module for all four drones, with the flag.++Object AmericaVehicleSentryDrone+ ReplaceModule ModuleTag_04+ Behavior = DeployStyleAIUpdate ModuleTag_04_Reforged+ Turret+ TurretTurnRate = 180+ TurretPitchRate = 180+ FirePitch = 0+ AllowsPitch = No+ RecenterTime = 1000+ ControlledWeaponSlots = PRIMARY+ NaturalTurretAngle = 0+ InitiallyDisabled = No+ MinIdleScanInterval = 250+ MaxIdleScanInterval = 250+ MinIdleScanAngle = 0+ MaxIdleScanAngle = 360+ End+ AutoAcquireEnemiesWhenIdle = Yes Stealthed+ PackTime = 1000+ UnpackTime = 1000+ TurretsFunctionOnlyWhenDeployed = Yes+ TurretsMustCenterBeforePacking = Yes+ End+ End+End++Object AirF_AmericaVehicleSentryDrone+ ReplaceModule ModuleTag_04+ Behavior = DeployStyleAIUpdate ModuleTag_04_Reforged+ Turret+ TurretTurnRate = 180+ TurretPitchRate = 180+ FirePitch = 0+ AllowsPitch = No+ RecenterTime = 1000+ ControlledWeaponSlots = PRIMARY+ NaturalTurretAngle = 0+ InitiallyDisabled = No+ MinIdleScanInterval = 250+ MaxIdleScanInterval = 250+ MinIdleScanAngle = 0+ MaxIdleScanAngle = 360+ End+ AutoAcquireEnemiesWhenIdle = Yes Stealthed+ PackTime = 1000+ UnpackTime = 1000+ TurretsFunctionOnlyWhenDeployed = Yes+ TurretsMustCenterBeforePacking = Yes+ End+ End+End++Object Lazr_AmericaVehicleSentryDrone+ ReplaceModule ModuleTag_04+ Behavior = DeployStyleAIUpdate ModuleTag_04_Reforged+ Turret+ TurretTurnRate = 180+ TurretPitchRate = 180+ FirePitch = 0+ AllowsPitch = No+ RecenterTime = 1000+ ControlledWeaponSlots = PRIMARY+ NaturalTurretAngle = 0+ InitiallyDisabled = No+ MinIdleScanInterval = 250+ MaxIdleScanInterval = 250+ MinIdleScanAngle = 0+ MaxIdleScanAngle = 360+ End+ AutoAcquireEnemiesWhenIdle = Yes Stealthed+ PackTime = 1000+ UnpackTime = 1000+ TurretsFunctionOnlyWhenDeployed = Yes+ TurretsMustCenterBeforePacking = Yes+ End+ End+End++Object SupW_AmericaVehicleSentryDrone+ ReplaceModule ModuleTag_04+ Behavior = DeployStyleAIUpdate ModuleTag_04_Reforged+ Turret+ TurretTurnRate = 180+ TurretPitchRate = 180+ FirePitch = 0+ AllowsPitch = No+ RecenterTime = 1000+ ControlledWeaponSlots = PRIMARY+ NaturalTurretAngle = 0+ InitiallyDisabled = No+ MinIdleScanInterval = 250+ MaxIdleScanInterval = 250+ MinIdleScanAngle = 0+ MaxIdleScanAngle = 360+ End+ AutoAcquireEnemiesWhenIdle = Yes Stealthed+ PackTime = 1000+ UnpackTime = 1000+ TurretsFunctionOnlyWhenDeployed = Yes+ TurretsMustCenterBeforePacking = Yes+ End+ End+End+; The Ambulance earns experience faster with Advanced Training and has no icon for it.Object AmericaVehicleMedicdiff --git a/GeneralsMD/Code/Data/Scenarios/empfriendly.txt b/GeneralsMD/Code/Data/Scenarios/empfriendly.txtnew file mode 100644index 000000000..55c01659f--- /dev/null+++ b/GeneralsMD/Code/Data/Scenarios/empfriendly.txt@@ -0,0 +1,27 @@+# The Superweapon General's EMP Patriot shooting at an enemy Helix with three of its own Comanches+# hovering on the same spot. Every missile leaves an EMP sphere where it bursts, and the question is+# who the sphere takes: the Helix should go down, the Comanches should not.+#+# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit+# -map "Maps\Twilight Flame\Twilight Flame.map" -autoskirmish 2 -takeover+# -side 0 FactionAmericaSuperWeaponGeneral -side 1 FactionChina -seed 7 -maxframes 900+# -scenario empfriendly -logPrefix empfriendly_+#+# Measured 2026-10-05, seed 7, with a temporary log of every victim the sphere killed or disabled.+# Before, EA's sphere spared only its own side's buildings, and an airborne aircraft it touched was+# killed whoever owned it (a god mode player's dropped to the ground and lifted off again, which is+# how the report came in): the four bursts on frames 79 to 92 killed the Helix and all three+# Comanches, and the frame 600 tally had none of either. After, the same four bursts killed the Helix+# and nothing else, and two Comanches were alive at 62 of 440 health. The one lost and the damage are+# not the sphere's, which named no Comanche; the likely cause, not checked, is the missiles' own+# blast, which hits allies on every Patriot, with three Comanches stacked on the target.++30 spawn 0 SupW_AmericaPowerPlant 1 2600 3150+30 spawn 0 SupW_AmericaPatriotBattery 1 2600 3000+30 spawn 1 ChinaVehicleHelix 1 2850 3000+30 spawn 0 SupW_AmericaVehicleComanche 3 2850 3000 15++600 tally 0 SupW_AmericaVehicleComanche+600 tally 1 ChinaVehicleHelix+880 tally 0 SupW_AmericaVehicleComanche+880 tally 1 ChinaVehicleHelixdiff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cppindex 57907f8a6..41e584706 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp@@ -246,6 +246,11 @@ void EMPUpdate::doDisableAttack( void )if (!curVictim->isKindOfMulti(data->m_victimKindOf, data->m_victimKindOfNot))continue;+ // DoesNotAffect = ALLIES spares the owner's side and its allies whatever they are. EA asked+ // it after the aircraft and structure branches, so a friendly aircraft in the sky was killed+ // and a teammate's building disabled before the question came up.+ if ( (data->m_rejectMask & WEAPON_AFFECTS_ALLIES) && curVictim->getRelationship( object ) == ALLIES )+ continue;@@ -296,11 +301,6 @@ void EMPUpdate::doDisableAttack( void )if ( ! curVictim->isFactionStructure() )continue;}- // handle cases where we do not want allies to be hit by it's own EMP weapons- else if ( (data->m_rejectMask & WEAPON_AFFECTS_ALLIES) && curVictim->getRelationship( object ) == ALLIES)- {- continue;- }//Disable the target for a specified amount of time.curVictim->setDisabledUntil( DISABLED_EMP, TheGameLogic->getFrame() + data->m_disabledDuration );