mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
refactor: extract markPlayerDead to deduplicate death/corpse caching
Both the health==0 and dynFlags UNIT_DYNFLAG_DEAD paths duplicated the same corpse-position caching and death-state logic with a subtle asymmetry (only health path called stopAutoAttack). Extracted into markPlayerDead() so coordinate swapping and state changes happen in one place. stopAutoAttack remains at the health==0 call site since the dynFlags path doesn't need it.
This commit is contained in:
parent
dc500fede9
commit
298974ebc2
2 changed files with 23 additions and 21 deletions
|
|
@ -169,6 +169,9 @@ private:
|
|||
void detectPlayerMountChange(uint32_t newMountDisplayId,
|
||||
const std::map<uint16_t, uint32_t>& blockFields);
|
||||
|
||||
// Shared player-death handler: caches corpse position, sets death state.
|
||||
void markPlayerDead(const char* source);
|
||||
|
||||
// --- Phase 4: Field index cache structs ---
|
||||
// Cached field indices resolved once per handler call to avoid repeated lookups.
|
||||
struct UnitFieldIndices {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue