Skip to content

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.

fix(gamelogic): three units that kept doing a thing they had finished

Olcay Seyganc191c68ea8b8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f59a3ffff..e6a311e10 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -394,6 +394,9 @@ found and fixed — EA's own, not port damage.**
- An order that names one selected unit when nothing is selected is dropped too, instead of reading off the end of an empty list.
- Subdual weapons work on a unit that is being healed. Healing could drive the subdual meter below zero and it stayed there, so the next stun gun had to fill a hole before it did anything.
- A stream of projectiles remembers which ones it fired. The list was cleared into a local of the same name, so the real one started as whatever was in the recycled memory.
+- A unit that has to deploy before firing does it standing still. It used to set up wherever it happened to be when the target came into range, then pack straight back up because it was still on its way somewhere.
+- An Aurora that went supersonic to attack comes back down again. The timer ran out and nothing put the normal engine back.
+- Calling in a gunship selects it for the player who called it, not for everyone watching the match.
- Something going wrong now writes a readable crash report.
## Long orders stopped hitching
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp
index 854656f9a..23a96f664 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp
@@ -148,7 +148,10 @@ UpdateSleepTime DeployStyleAIUpdate::update( void )
}
}
- if( isInRange || isInGuardIdleState )
+ // The pathfinder uses a stricter idea of attack range than this does, so being "in range" here
+ // is not enough: a unit still on its way to somewhere would deploy where it stood and start
+ // shooting, then have to pack up again. It has to be standing still.
+ if( !isTryingToMove && (isInRange || isInGuardIdleState) )
{
switch( m_state )
{
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp
index 598c83b5c..b1a72b4e5 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp
@@ -2028,6 +2028,9 @@ UpdateSleepTime JetAIUpdate::update()
if (m_attackLocoExpireFrame != 0 && now >= m_attackLocoExpireFrame)
{
m_attackLocoExpireFrame = 0;
+ // the timer ran out and nothing put the normal locomotor back, so an Aurora that had
+ // gone supersonic to attack stayed supersonic for the rest of its life
+ chooseLocomotorSet(LOCOMOTORSET_NORMAL);
}
if (m_attackersMissExpireFrame != 0 && now >= m_attackersMissExpireFrame)
{
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp
index c82da2258..26bfe4435 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp
@@ -242,7 +242,9 @@ Bool SpectreGunshipDeploymentUpdate::initiateIntentToDoSpecialPower(const Specia
// MAKE THE GUNSHIP SELECTED
- TheGameLogic->selectObject( newGunship, TRUE, getObject()->getControllingPlayer()->getPlayerMask(), TRUE );
+ // the last argument says "this is a local selection", and passing TRUE said that on every
+ // machine - so calling in a gunship selected it for everybody watching, not just its owner
+ TheGameLogic->selectObject( newGunship, TRUE, getObject()->getControllingPlayer()->getPlayerMask(), newGunship->isLocallyControlled() );
}