mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-05 04:33:51 +00:00
physics: block client-side movement when server roots the player
When SMSG_FORCE_MOVE_ROOT sets ROOT in movementInfo.flags, the camera controller was not aware and continued to accept directional input. This caused position desync (client moves, server sees player as rooted). - Add movementRooted_ flag to CameraController with setter/getter. - Block nowForward/nowBackward/nowStrafe when movementRooted_ is set. - Sync isPlayerRooted() from GameHandler to CameraController each frame alongside the existing run-speed sync in application.cpp. - Add GameHandler::isPlayerRooted() convenience accessor.
This commit is contained in:
parent
ea291179dd
commit
21604461fc
4 changed files with 12 additions and 2 deletions
|
|
@ -92,6 +92,8 @@ public:
|
|||
void setMovementCallback(MovementCallback cb) { movementCallback = std::move(cb); }
|
||||
void setUseWoWSpeed(bool use) { useWoWSpeed = use; }
|
||||
void setRunSpeedOverride(float speed) { runSpeedOverride_ = speed; }
|
||||
void setMovementRooted(bool rooted) { movementRooted_ = rooted; }
|
||||
bool isMovementRooted() const { return movementRooted_; }
|
||||
void setMounted(bool m) { mounted_ = m; }
|
||||
void setMountHeightOffset(float offset) { mountHeightOffset_ = offset; }
|
||||
void setExternalFollow(bool enabled) { externalFollow_ = enabled; }
|
||||
|
|
@ -268,6 +270,8 @@ private:
|
|||
|
||||
// Server-driven run speed override (0 = use default WOW_RUN_SPEED)
|
||||
float runSpeedOverride_ = 0.0f;
|
||||
// Server-driven root state: when true, block all horizontal movement input.
|
||||
bool movementRooted_ = false;
|
||||
bool mounted_ = false;
|
||||
float mountHeightOffset_ = 0.0f;
|
||||
bool externalMoving_ = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue