mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: fire PLAYER_ENTER_COMBAT and PLAYER_LEAVE_COMBAT events
Fire PLAYER_ENTER_COMBAT when the player's auto-attack starts (SMSG_ATTACKSTART) and PLAYER_LEAVE_COMBAT when auto-attack stops. These events are distinct from PLAYER_REGEN_DISABLED/ENABLED — they specifically track physical melee combat state and are used by combat-aware addons for weapon swing timers and attack state tracking.
This commit is contained in:
parent
60904e2e15
commit
760c6a2790
1 changed files with 4 additions and 0 deletions
|
|
@ -16043,6 +16043,8 @@ void GameHandler::stopAutoAttack() {
|
|||
socket->send(packet);
|
||||
}
|
||||
LOG_INFO("Stopping auto-attack");
|
||||
if (addonEventCallback_)
|
||||
addonEventCallback_("PLAYER_LEAVE_COMBAT", {});
|
||||
}
|
||||
|
||||
void GameHandler::addCombatText(CombatTextEntry::Type type, int32_t amount, uint32_t spellId, bool isPlayerSource, uint8_t powerType,
|
||||
|
|
@ -16164,6 +16166,8 @@ void GameHandler::handleAttackStart(network::Packet& packet) {
|
|||
autoAttacking = true;
|
||||
autoAttackRetryPending_ = false;
|
||||
autoAttackTarget = data.victimGuid;
|
||||
if (addonEventCallback_)
|
||||
addonEventCallback_("PLAYER_ENTER_COMBAT", {});
|
||||
} else if (data.victimGuid == playerGuid && data.attackerGuid != 0) {
|
||||
hostileAttackers_.insert(data.attackerGuid);
|
||||
autoTargetAttacker(data.attackerGuid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue