From 74ac7bf704d8a435977841f3253d7958cf795def Mon Sep 17 00:00:00 2001 From: MrS-ibra Date: Thu, 1 Jan 2026 14:30:28 +0300 Subject: [PATCH 1/2] CR LF --- GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index eafdb84cac1..1d1dc36c0c4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -657,7 +657,7 @@ Bool InGameUI::removeSuperweapon(Int playerIndex, const AsciiString& powerName, SuperweaponInfo *info = *listIt; swList.erase(listIt); deleteInstance(info); - if (swList.empty()) + if (swList.empty()) { m_superweapons[playerIndex].erase(mapIt); } @@ -4746,7 +4746,7 @@ Bool InGameUI::canSelectedObjectsDoSpecialPower( const CommandButton *command, c if (ignoreSelDraw) tmpList.push_back(ignoreSelDraw); - const DrawableList* selected = (!tmpList.empty()) ? &tmpList : TheInGameUI->getAllSelectedDrawables(); + const DrawableList* selected = (!tmpList.empty()) ? &tmpList : TheInGameUI->getAllSelectedDrawables(); // set up counters for rule checking Int count = 0; @@ -5009,7 +5009,7 @@ Int InGameUI::selectMatchingAcrossRegion( IRegion2D *region ) } } - if (drawableList.empty()) + if (drawableList.empty()) return -1; // nothing useful selected to begin with - don't bother iterating std::set::iterator iter; From 2bbb4e05b4cc7625a3100055f3d219926a7d758a Mon Sep 17 00:00:00 2001 From: MrS-ibra Date: Thu, 1 Jan 2026 14:32:08 +0300 Subject: [PATCH 2/2] snap buildings rotation at 45 degrees --- .../Code/GameEngine/Source/GameClient/InGameUI.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index 1d1dc36c0c4..fa88a20afa6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -1562,6 +1562,14 @@ void InGameUI::handleBuildPlacements( void ) v.y = worldEnd.y - worldStart.y; angle = v.toAngle(); + // Use force attack mode to control snapping for convenience + if (isInForceAttackMode()) + { + // TheSuperHackers @tweak Stubbjax 04/08/2025 Snap angle to nearest 45 degrees (pi/4 radians) + const Real snapRadians = PI / 4.0f; + angle = floor((angle / snapRadians) + 0.5f) * snapRadians; + } + } } @@ -6337,3 +6345,4 @@ void InGameUI::drawGameTime() m_gameTimeFrameString->draw(horizontalFrameOffset, m_gameTimePosition.y, GameMakeColor(180,180,180,255), m_gameTimeDropColor); } +