From d20357415bf113ee89c9f830ea2e4310f3b52efa Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 21 Mar 2026 05:42:57 -0700 Subject: [PATCH] feat: fire PLAYER_CONTROL_LOST/GAINED on movement control changes Fire PLAYER_CONTROL_LOST when SMSG_CLIENT_CONTROL_UPDATE revokes player movement (stun, fear, mind control, etc.) and PLAYER_CONTROL_GAINED when movement is restored. Used by loss-of-control addons and action bar addons to show stun/CC indicators and disable ability buttons during crowd control. --- src/game/game_handler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index aa757382..61d7f941 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -3295,8 +3295,10 @@ void GameHandler::handlePacket(network::Packet& packet) { sendMovement(Opcode::MSG_MOVE_STOP_TURN); sendMovement(Opcode::MSG_MOVE_STOP_SWIM); addSystemChatMessage("Movement disabled by server."); + if (addonEventCallback_) addonEventCallback_("PLAYER_CONTROL_LOST", {}); } else if (changed && allowMovement) { addSystemChatMessage("Movement re-enabled."); + if (addonEventCallback_) addonEventCallback_("PLAYER_CONTROL_GAINED", {}); } } break;