From 7f3c7379b54c8ae613891c11ec393898ee74da64 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 28 Mar 2026 16:45:57 -0700 Subject: [PATCH] debug: log pre-cast facing orientation details --- src/game/spell_handler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game/spell_handler.cpp b/src/game/spell_handler.cpp index 5e926d91..70a3b919 100644 --- a/src/game/spell_handler.cpp +++ b/src/game/spell_handler.cpp @@ -311,7 +311,13 @@ void SpellHandler::castSpell(uint32_t spellId, uint64_t targetGuid) { float dy = entity->getY() - owner_.movementInfo.y; float lenSq = dx * dx + dy * dy; if (lenSq > 0.01f) { - owner_.movementInfo.orientation = std::atan2(dy, dx); + float canonYaw = std::atan2(dy, dx); + float serverYaw = core::coords::canonicalToServerYaw(canonYaw); + owner_.movementInfo.orientation = canonYaw; + LOG_WARNING("Pre-cast facing: target=(", entity->getX(), ",", entity->getY(), + ") me=(", owner_.movementInfo.x, ",", owner_.movementInfo.y, + ") canonYaw=", canonYaw, " serverYaw=", serverYaw, + " dx=", dx, " dy=", dy); owner_.sendMovement(Opcode::MSG_MOVE_SET_FACING); owner_.sendMovement(Opcode::MSG_MOVE_HEARTBEAT); }