diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h index e0aaff613d0..bcae1fe415d 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h @@ -444,6 +444,8 @@ friend class Drawable; // for selection/deselection transactions virtual Bool isPlacementAnchored( void ); ///< is placement arrow anchor set virtual void getPlacementPoints( ICoord2D *start, ICoord2D *end );///< get the placemnt arrow points virtual Real getPlacementAngle( void ); ///< placement angle of drawable at cursor when placing down structures + virtual Real getLatestBuildingOrientation() const { return m_latestBuildingOrientation; } ///< TBD + virtual void setLatestBuildingOrientation(Real angle) { m_latestBuildingOrientation = angle; } ///< TBD // Drawable selection mechanisms virtual void selectDrawable( Drawable *draw ); ///< Mark given Drawable as "selected" @@ -742,6 +744,7 @@ friend class Drawable; // for selection/deselection transactions Bool m_placeAnchorInProgress; ///< is place angle interface for placement active ICoord2D m_placeAnchorStart; ///< place angle anchor start ICoord2D m_placeAnchorEnd; ///< place angle anchor end + Real m_latestBuildingOrientation; ///< latest building orientation Int m_selectCount; ///< Number of objects currently "selected" Int m_maxSelectCount; ///< Max number of objects to select UnsignedInt m_frameSelectionChanged; ///< Frame when the selection last changed. diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index c95896fa9ef..2aab0580338 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -1131,6 +1131,7 @@ InGameUI::InGameUI() m_placeAnchorStart.x = m_placeAnchorStart.y = 0; m_placeAnchorEnd.x = m_placeAnchorEnd.y = 0; m_placeAnchorInProgress = FALSE; + m_latestBuildingOrientation = RANDOM_START_ANGLE; m_videoStream = nullptr; m_videoBuffer = nullptr; @@ -1652,9 +1653,14 @@ void InGameUI::handleBuildPlacements( void ) } } + m_latestBuildingOrientation = RANDOM_START_ANGLE; } else { + // TheSuperHackers @tweak Caball009 10/02/2026 Use force attack to get the latest building orientation for convenience. + if (isInForceAttackMode() && m_latestBuildingOrientation != RANDOM_START_ANGLE) + angle = m_latestBuildingOrientation; + const MouseIO *mouseIO = TheMouse->getMouseStatus(); // location is the mouse position @@ -2159,6 +2165,7 @@ void InGameUI::reset( void ) // remove any build available status placeBuildAvailable( nullptr, nullptr ); + m_latestBuildingOrientation = RANDOM_START_ANGLE; // free any message resources allocated freeMessageResources(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp index 0d6999bbd98..93f7df0b329 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp @@ -284,6 +284,8 @@ GameMessageDisposition PlaceEventTranslator::translateGameMessage(const GameMess // get out of pending placement mode, this will also clear the arrow anchor status TheInGameUI->placeBuildAvailable( nullptr, nullptr ); + // TheSuperHackers @tweak Caball009 10/02/2026 Store the latest building orientation for convenience. + TheInGameUI->setLatestBuildingOrientation(angle); } else {