@@ -107,6 +107,7 @@ function MPT:EventHandler(e, ...) -- internal checks whether the event comes fro
107107 elseif e == " CHALLENGE_MODE_DEATH_COUNT_UPDATED" then
108108 self :UpdateKeyInfo (false , true )
109109 elseif e == " CHALLENGE_MODE_START" then
110+ self .PlayerDeaths = {}
110111 self :Init ()
111112 self :ToggleEventRegister (true )
112113 elseif e == " CHALLENGE_MODE_COMPLETED" then
@@ -150,12 +151,19 @@ function MPT:EventHandler(e, ...) -- internal checks whether the event comes fro
150151 self :CreateMiniMapButton ()
151152 elseif e == " COMBAT_LOG_EVENT_UNFILTERED" and C_ChallengeMode .IsChallengeModeActive () then
152153 if GetRestrictedActionStatus then return end -- disable for midnight. Edit this later when I know how the API works
153- local _ , se , _ , _ , _ , _ , _ , destGUID = CombatLogGetCurrentEventInfo ()
154+ local _ , se , _ , _ , _ , _ , _ , destGUID , destName = CombatLogGetCurrentEventInfo ()
154155 if (se == " UNIT_DIED" or se == " UNIT_DESTROYED" or se == " UNIT_DISSIPATES" ) and destGUID then
155156 if self .CurrentPull and self .CurrentPull [destGUID ] then
156157 self .CurrentPull [destGUID ] = " DEAD"
157158 if not self .done then self :UpdateCurrentPull () end
158159 end
160+ if se == " UNIT_DIED" and destName and UnitIsPlayer (destName ) then
161+ self .PlayerDeaths = self .PlayerDeaths or {}
162+ num = self .PlayerDeaths and self .PlayerDeaths [destName ] or 0
163+ if UnitHealth (destName ) == 0 then
164+ self .PlayerDeaths [destName ] = num and num + 1 or 1
165+ end
166+ end
159167 end
160168 elseif e == " UNIT_THREAT_LIST_UPDATE" and C_ChallengeMode .IsChallengeModeActive () and InCombatLockdown () then
161169 if GetRestrictedActionStatus then return end -- disable for midnight. Edit this later when I know how the API works
0 commit comments