mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
physics: disable gravity when server sends SMSG_MOVE_GRAVITY_DISABLE
SMSG_MOVE_GRAVITY_DISABLE/ENABLE now correctly set/clear the LEVITATING movement flag instead of passing flag=0. GameHandler::isGravityDisabled() reads the LEVITATING bit and is synced to CameraController each frame. When gravity is disabled the physics loop bleeds off downward velocity and skips gravity accumulation, so Levitate and similar effects actually float the player rather than letting them fall through the world.
This commit is contained in:
parent
dd6f6d1174
commit
f2337aeaa7
5 changed files with 19 additions and 4 deletions
|
|
@ -94,6 +94,7 @@ public:
|
|||
void setRunSpeedOverride(float speed) { runSpeedOverride_ = speed; }
|
||||
void setMovementRooted(bool rooted) { movementRooted_ = rooted; }
|
||||
bool isMovementRooted() const { return movementRooted_; }
|
||||
void setGravityDisabled(bool disabled) { gravityDisabled_ = disabled; }
|
||||
void setMounted(bool m) { mounted_ = m; }
|
||||
void setMountHeightOffset(float offset) { mountHeightOffset_ = offset; }
|
||||
void setExternalFollow(bool enabled) { externalFollow_ = enabled; }
|
||||
|
|
@ -272,6 +273,8 @@ private:
|
|||
float runSpeedOverride_ = 0.0f;
|
||||
// Server-driven root state: when true, block all horizontal movement input.
|
||||
bool movementRooted_ = false;
|
||||
// Server-driven gravity disable (levitate/hover): skip gravity accumulation.
|
||||
bool gravityDisabled_ = false;
|
||||
bool mounted_ = false;
|
||||
float mountHeightOffset_ = 0.0f;
|
||||
bool externalMoving_ = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue