From 1aec1c6cf11160230b58790fa7c9fbe1f32029d2 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 28 Mar 2026 16:27:26 -0700 Subject: [PATCH] fix: send heartbeat after SET_FACING before cast to ensure server has orientation --- src/game/spell_handler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game/spell_handler.cpp b/src/game/spell_handler.cpp index 98a6c671..3743d2db 100644 --- a/src/game/spell_handler.cpp +++ b/src/game/spell_handler.cpp @@ -300,7 +300,9 @@ void SpellHandler::castSpell(uint32_t spellId, uint64_t targetGuid) { } } - // Face the target before casting any targeted spell (server checks facing arc) + // Face the target before casting any targeted spell (server checks facing arc). + // Send both SET_FACING and a HEARTBEAT so the server has the updated orientation + // before it processes the cast packet. if (target != 0) { auto entity = owner_.entityManager.getEntity(target); if (entity) { @@ -310,6 +312,7 @@ void SpellHandler::castSpell(uint32_t spellId, uint64_t targetGuid) { if (lenSq > 0.01f) { owner_.movementInfo.orientation = std::atan2(dy, dx); owner_.sendMovement(Opcode::MSG_MOVE_SET_FACING); + owner_.sendMovement(Opcode::MSG_MOVE_HEARTBEAT); } } }