mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-08 22:23:50 +00:00
fix: send heartbeat after SET_FACING before cast to ensure server has orientation
This commit is contained in:
parent
9cb6c596d5
commit
1aec1c6cf1
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue