Repository navigation
fix: keep restored vehicle heading when steering - #60
Conversation
Turning steps from the rotator's cached driveYaw. Restoring a saved rotation (rawSet) and reset() wrote the bone quaternion without updating that cache, so it stayed at the model's rest yaw. The first A/D press after a vehicle was loaded from the database snapped it back to its spawn heading, which players saw as ships flipping 180 degrees when they started sailing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 SummarySummary by CodeRabbit
Walkthrough
ChangesBone rotator yaw synchronisation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is identified; the change is ready for normal merge checks.
Comment |
Problem
Bug report (Archbishqp, 2026-10-02): starting a ship sometimes flips it 180°. The clip is kleinovac's gunboat on Main (captain seat taken 2026-09-29 19:50:11 UTC at 4331, 3933). At about 35% throttle the boat goes from bow-first to stern-first between two frames 100 ms apart, then sails the opposite way.
Cause
RotateController.turnbuilds the new heading fromBoneRotator.getDriveYaw(), a cached yaw added in 3ebdcb1. Two paths write the bone quaternion without updating that cache:rawSet, used byActiveVehicle.initializeRotationswhen a vehicle is loaded from the database (restart, chunk reload)reset, used byTowHandlerAfter a reload,
driveYawstays at the model's rest yaw. The first A/D press snaps the vehicle back to its spawn heading plus one turn step. Turn rate is 0 while speed is 0 (AccessPanel.getTurnRate), so the snap happens on the first steer once the ship is moving.Fix
rawSetandresetnow setdriveYawfrom the quaternion they write, the same way the skin-change path (updateModel) already does.Tests
BoneRotatorDriveYawTest: restore a rotator at 170°, steer once. Without the fix it lands at 1.2°; with the fix it lands at 171.2°. The reset case is covered too.mvn verify: 691 tests pass.🤖 Generated with Claude Code