mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 08:00:14 +00:00
rendering/game: sync camera sit state from server-confirmed stand state
Add CameraController::setSitting() and call it from the StandStateCallback so the camera blocks movement when the server confirms the player is sitting or kneeling (stand states 1-6, 8). This prevents the player from sliding across the ground after sitting. Death (state 7) deliberately leaves sitting=false so the player can still respawn/move after death without input being blocked.
This commit is contained in:
parent
9f3c236c48
commit
366321042f
2 changed files with 9 additions and 1 deletions
|
|
@ -2795,8 +2795,15 @@ void Application::setupUICallbacks() {
|
|||
});
|
||||
|
||||
// Stand state animation callback — map server stand state to M2 animation on player
|
||||
// and sync camera sit flag so movement is blocked while sitting
|
||||
gameHandler->setStandStateCallback([this](uint8_t standState) {
|
||||
if (!renderer) return;
|
||||
|
||||
// Sync camera controller sitting flag: block movement while sitting/kneeling
|
||||
if (auto* cc = renderer->getCameraController()) {
|
||||
cc->setSitting(standState >= 1 && standState <= 8 && standState != 7);
|
||||
}
|
||||
|
||||
auto* cr = renderer->getCharacterRenderer();
|
||||
if (!cr) return;
|
||||
uint32_t charInstId = renderer->getCharacterInstanceId();
|
||||
|
|
@ -2813,7 +2820,7 @@ void Application::setupUICallbacks() {
|
|||
} else if (standState == 8) {
|
||||
animId = 72; // Kneel
|
||||
}
|
||||
// Non-looping sit/kneel looks wrong frozen; loop them so the held-pose frame shows
|
||||
// Loop sit/kneel (not death) so the held-pose frame stays visible
|
||||
const bool loop = (animId != 1);
|
||||
cr->playAnimation(charInstId, animId, loop);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue