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): fuel-less aircraft idle, found airfield lands at once
Olcay Seygand5a5b90e7f0a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e53632dbe..9aed30ac2 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -694,7 +694,7 @@ found and fixed, EA's own, not port damage.**- Two jets on one airfield could deadlock waiting for each other; now they go.- Losing the airfield no longer leaves its aircraft circling rubble forever.- A jet looking for a new airfield no longer locks parking spaces it never uses. The search booked a space at every airfield it looked at on the way to the nearest, and each of those stayed booked for that jet until it died: an empty spot on the tarmac no other plane could land on and the airfield could not build into.-- A jet whose airfield is gone no longer haunts your base. One that still had a bomb or a missile on board was let off the fuel clock EA gives every homeless jet, so with every other airfield full it hung over the ruin for the rest of the match, half dead and never repaired: a damaged Aurora orbiting a base of ten full airfields. It now circles the ruin with the empty ones, checks every second for a free spot, lands on the first that opens and goes down when its fuel runs out. A jet a map places in the air without an airfield still waits instead.+- A jet whose airfield is gone no longer haunts your base. One that still had a bomb or a missile on board was let off the fuel clock EA gives every homeless jet, so with every other airfield full it hung over the ruin for the rest of the match, half dead and never repaired: a damaged Aurora orbiting a base of ten full airfields. It now circles the ruin with the empty ones, checks every second for a free spot, lands on the first that opens and goes down when its fuel runs out. A jet a map places in the air without an airfield still waits instead, and so does a helicopter, which has no fuel clock to run out.- Repaired aircraft fly to the rally point instead of hovering over the pad.- Infantry leaving a captured building follow its rally point too.- The Spectre gunship's crosshair answers your right click. Its gun only walked its fire toward a new spot while it was already shooting, so moving the crosshair onto ground the gun could not reach that moment froze the fire on the old spot for the rest of the orbit. Now the cannon rakes across to every click inside the target circle and the howitzer follows it there; a click outside the circle stops at its edge, as before, and the plane keeps circling where you called it. It also opens up on enemies anywhere in the circle when the crosshair sits on empty ground, which EA had only let the computer's gunships do. Yours and the computer's now follow the same rules. Measured on Alpine Assault: moved three times in one orbit, the first move had shells on the new spot under two seconds after the click, and four Battlemasters parked in the circle were all dead before the plane left.diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cppindex c5bdf3e0c..7673dd6bc 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp@@ -478,7 +478,10 @@ public:// one whose airfield is gone, and that jet, still carrying a bomb, used to be punted out here// too: idle, back ten seconds later, punted again, never burning and never landing, a damaged// Aurora orbiting a full base for the rest of the match. It circles the ruin with the rest now.- if (!jetAI->isOutOfSpecialReloadAmmo() && jet->getProducerID() == INVALID_ID && !jetAI->friend_hadAirfield())+ // One with no fuel to burn (a Comanche, a Chinook) would hang over the ruin for good, so that+ // one still goes back to idle as EA had it.+ if (!jetAI->isOutOfSpecialReloadAmmo() && jet->getProducerID() == INVALID_ID &&+ (!jetAI->friend_hadAirfield() || jetAI->friend_getOutOfAmmoDamagePerSecond() <= 0.0f)){return STATE_FAILURE;}@@ -1923,7 +1926,9 @@ JetAIStateMachine::JetAIStateMachine(Object *owner, AsciiString name) : AIStateMdefineState( ORIENT_FOR_PARKING_PLACE, newInstance(JetOrHeliParkOrientState)( this ), RELOAD_AMMO, AI_IDLE );defineState( RELOAD_AMMO, newInstance(JetOrHeliReloadAmmoState)( this ), AI_IDLE, AI_IDLE );defineState( RETURN_TO_DEAD_AIRFIELD, newInstance(JetOrHeliReturningToDeadAirfieldState)( this ), CIRCLING_DEAD_AIRFIELD, RETURN_TO_DEAD_AIRFIELD );- defineState( CIRCLING_DEAD_AIRFIELD, newInstance(JetOrHeliCirclingDeadAirfieldState)( this ), AI_IDLE, AI_IDLE );+ // a free space found goes straight to landing on it: through idle, a jet still armed waited out+ // ReturnToBaseIdleTime holding the space, and one with no such time never came down at all+ defineState( CIRCLING_DEAD_AIRFIELD, newInstance(JetOrHeliCirclingDeadAirfieldState)( this ), RETURNING_FOR_LANDING, AI_IDLE );}//-------------------------------------------------------------------------------------------------