diff --git a/src/states/PaperDoll.ts b/src/states/PaperDoll.ts index d9c6e5988..53f070f9f 100644 --- a/src/states/PaperDoll.ts +++ b/src/states/PaperDoll.ts @@ -1,7 +1,7 @@ import { Tracer, DebugTools } from "../engine/debug"; import { Profiler, OvaleProfilerClass } from "../engine/profiler"; import { OvaleClass } from "../Ovale"; -import { OvaleEquipmentClass } from "./Equipment"; +import { OvaleEquipmentClass, SlotName } from "./Equipment"; import { States, StateModule } from "../engine/state"; import aceEvent, { AceEvent } from "@wowts/ace_event-3.0"; import { tonumber, LuaObj, LuaArray, ipairs, unpack } from "@wowts/lua"; @@ -291,7 +291,7 @@ export class OvalePaperDollClass // this.RegisterEvent("PLAYER_DAMAGE_DONE_MODS"); // SpellBonusHealing (not really needed; spell power covered by SPELL_POWER_CHANGED) this.module.RegisterMessage( "Ovale_EquipmentChanged", - this.handleUpdateDamage + this.handleOvaleEquipmentChanged ); // this.RegisterMessage("Ovale_StanceChanged", "UpdateDamage"); // Shouldn't be needed anymore, UNIT_DAMAGE covers it this.module.RegisterMessage( @@ -319,7 +319,18 @@ export class OvalePaperDollClass this.module.UnregisterMessage("Ovale_StanceChanged"); this.module.UnregisterMessage("Ovale_TalentsChanged"); }; - private handleUnitStats = (unitId: string) => { + + private handleOvaleEquipmentChanged = (event: string, slot: SlotName) => { + if ( + slot == "mainhandslot" || + slot == "secondaryhandslot" || + slot == "offhandslot" + ) { + this.handleUpdateDamage(); + } + }; + + private handleUnitStats = (event: string, unitId: string) => { if (unitId == "player") { this.profiler.startProfiling("OvalePaperDoll_UpdateStats"); this.current.strength = UnitStat(unitId, 1); @@ -438,7 +449,7 @@ export class OvalePaperDollClass } private handleUpdateStats = (event: string) => { this.updateSpecialization(); - this.handleUnitStats("player"); + this.handleUnitStats(event, "player"); this.handleCombatRatingUpdate(); this.handleMasteryUpdate(); this.handleUnitAttackPower(event, "player");