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): stop the destination override falling into the attack case

Olcay Seygan773967948aae
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
index 2fe70f8a3..ff3748b81 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
@@ -1319,7 +1319,13 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
currentlySelectedGroup->groupOverrideSpecialPowerDestination( spType, loc, CMD_FROM_PLAYER );
}
}
- }
+
+ // This case had no break and fell into MSG_DO_ATTACK_OBJECT, which reads argument 0 as an
+ // object id - here that argument is a Coord3D, so the union handed findObjectByID the raw
+ // float bits of the x coordinate.
+ break;
+
+ } // end override special power destination
//---------------------------------------------------------------------------------------------
case GameMessage::MSG_DO_ATTACK_OBJECT: