File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
GeneralsMD/Code/GameEngine/Source/GameClient
Generals/Code/GameEngine/Source/GameClient Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1415,6 +1415,13 @@ void InGameUI::handleBuildPlacements( void )
14151415 v.y = worldEnd.y - worldStart.y ;
14161416 angle = v.toAngle ();
14171417
1418+ // Use force attack mode to control snapping for convenience
1419+ if (isInForceAttackMode ())
1420+ {
1421+ // TheSuperHackers @tweak Stubbjax 04/08/2025 Snap angle to nearest 45 degrees (pi/4 radians)
1422+ const Real snapRadians = PI / 4 .0f ;
1423+ angle = floor ((angle / snapRadians) + 0 .5f ) * snapRadians;
1424+ }
14181425 } // end if
14191426
14201427 } // end if
Original file line number Diff line number Diff line change @@ -1470,6 +1470,13 @@ void InGameUI::handleBuildPlacements( void )
14701470 v.y = worldEnd.y - worldStart.y ;
14711471 angle = v.toAngle ();
14721472
1473+ // Use force attack mode to control snapping for convenience
1474+ if (isInForceAttackMode ())
1475+ {
1476+ // TheSuperHackers @tweak Stubbjax 04/08/2025 Snap angle to nearest 45 degrees (pi/4 radians)
1477+ const Real snapRadians = PI / 4 .0f ;
1478+ angle = floor ((angle / snapRadians) + 0 .5f ) * snapRadians;
1479+ }
14731480 } // end if
14741481
14751482 } // end if
You can’t perform that action at this time.
0 commit comments