File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2519,7 +2519,11 @@ void handle_se11(DDukeActor *actor)
25192519 if (actor->temp_data [4 ] <= -511 || actor->temp_data [4 ] >= 512 )
25202520 {
25212521 actor->temp_data [4 ] = 0 ;
2522- actor->temp_angle = mapangle (actor->temp_angle .Buildang () & 0xffffff00 ); // Gross hack! What is this supposed to do?
2522+ // Normalize to avoid getting negative Build angle on CCW rotations
2523+ int snapped = actor->temp_angle .Normalized360 ().Buildang ();
2524+ // Quantize to 256-bit increments to prevent vector drift (legacy Build behavior)
2525+ snapped &= 0xffffff00 ;
2526+ actor->temp_angle = mapangle (snapped);
25232527 movesector (actor, actor->temp_data [1 ], actor->temp_angle );
25242528 // SetActor(actor, actor->spr.pos);
25252529 }
You can’t perform that action at this time.
0 commit comments