fix: label player auto attack damage events (#15)

This commit is contained in:
Codex Bot authored and warren committed 2026-10-15 09:10:20 -04:00
1 parent 3687c423e2
commit 89b6f4f79d
2 files changed
+195 -1

No files matched your search

+14 -1
View File
@@ -7682,6 +7682,7 @@ function damageMobInWork(
primarySaintsBlessingMultiplierAlreadyApplied = false,
directPhysicalArmorAttackerLevel?: number,
attackHand?: import("./combatEvents").StructuredCombatEvent["attackHand"],
reportedAbilityId?: string,
): DamageResult {
const mob = work.mobs[id];
if (!mob || mob.dead || amount <= 0 || (mob.navigationEvadeUntil ?? 0) > now) {
@@ -7771,12 +7772,14 @@ function damageMobInWork(
const primaryApplied = secondaryDamage
? Math.min(applied, Math.max(0, Math.round(primaryRemainingDamage)))
: applied;
// This override labels the primary event only; the ThreatSource stays authoritative for mechanics.
const combatEventAbilityId = reportedAbilityId ?? source.abilityId;
recordCombatEventInWork(work, {
occurredAt: now,
kind: "damage",
sourceActorId: source.actorId,
targetActorId: id,
...(source.abilityId ? { abilityId: source.abilityId } : {}),
...(combatEventAbilityId ? { abilityId: combatEventAbilityId } : {}),
school,
...(attackHand ? { attackHand } : {}),
rawAmount: combatResult?.rawDamage !== undefined
@@ -9465,6 +9468,12 @@ function maybeMirrorDeathKnightDancingRuneWeaponMeleeInWork(
source,
school,
work.gearStats.spellPenetration,
undefined,
undefined,
false,
undefined,
undefined,
WOW335_DEATH_KNIGHT_DANCING_RUNE_WEAPON_ABILITY_ID,
);
}
@@ -9578,6 +9587,7 @@ function resolveAndDamageMobInWork(
criticalChanceBonusPercent = 0,
weaponSpeedMs = work.gearStats.meleeWeapon?.speedMs ?? WOW335_SHAMAN_MAELSTROM_WEAPON_DEFAULT_SPEED_MS,
selectedDbcSpellId?: number,
reportedAbilityId?: string,
): DamageResult {
const mob = work.mobs[id];
if (!mob || mob.dead || amount <= 0 || (mob.navigationEvadeUntil ?? 0) > now) {
@@ -9945,6 +9955,7 @@ function resolveAndDamageMobInWork(
: sourceWeaponChannel === "off-hand" ? "offhand"
: sourceWeaponChannel === "ranged" ? "ranged" : undefined
: undefined,
reportedAbilityId,
);
maybeProcShamanFlurryInWork(
work,
@@ -24460,6 +24471,8 @@ export const useCombatStore = create<CombatState>((set, get) => ({
{ isAutoAttack: true, isDualWielding },
0,
mainHandSpeedMs,
undefined,
"player-auto-attack",
);
const runeWeaponMainHand = state.classId === "death-knight"
&& result.combatResult?.landed