diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index eafdb84cac1..fa88a20afa6 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); } @@ -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; + } + } } @@ -4746,7 +4754,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 +5017,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; @@ -6337,3 +6345,4 @@ void InGameUI::drawGameTime() m_gameTimeFrameString->draw(horizontalFrameOffset, m_gameTimePosition.y, GameMakeColor(180,180,180,255), m_gameTimeDropColor); } +