Skip to content

Commit f60b1da

Browse files
committed
Performance improvements for classic
1 parent cec4592 commit f60b1da

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

SheepMonitor.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Title: Sheep Monitor
33
## Notes: Provides various methods of notification to help you keep track of your flock.
44
## Author: funkjedi
5-
## Version: 1.33
5+
## Version: 1.34
66
## SavedVariables: SheepMonitorDatabase
77
## OptionalDeps: Ace3, LibAuraInfo-1.0
88
## X-Curse-Project-ID: 28218

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.34
2+
- performance improvements for classic
3+
14
1.33
25
- fixes for classic CLEU errors
36
- guard against secret spellIds

main.lua

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ function SheepMonitor:HandleUnitAuraClassic(unitTarget, destGUID)
193193
end
194194

195195
function SheepMonitor:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
196-
local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2 =
197-
CombatLogGetCurrentEventInfo()
196+
local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2,
197+
spellId, spellName = CombatLogGetCurrentEventInfo()
198198

199199
local isDamageEvent = damageEventTypes[eventType]
200200
local isAuraRemoved = eventType == 'SPELL_AURA_REMOVED'
@@ -207,20 +207,19 @@ function SheepMonitor:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
207207
if eventType == 'SWING_DAMAGE' then
208208
self:AuraBroken(destGUID, sourceName, 'Melee')
209209
else
210-
local spellId, spellName = select(12, CombatLogGetCurrentEventInfo())
211210
self:AuraBroken(destGUID, sourceName, spellName or 'Unknown')
212211
end
213212
end
214213

215214
if isAuraRemoved then
216-
local spellId, spellName = select(12, CombatLogGetCurrentEventInfo())
215+
local _
217216

218-
-- classic always returns a spell id of zero so we
219-
-- resolve the spell id using the spell name instead
220-
if spellName then
221-
spellId = select(7, SheepMonitor.GetSpellInfo(spellName)) or spellId
217+
if spellId < 1 and spellName then
218+
_, _, _, _, _, _, spellId = SheepMonitor.GetSpellInfo(spellName)
222219
end
223220

221+
spellId = spellId or 0
222+
224223
if self.trackableAuras[spellId] then
225224
self:AuraRemoved(destGUID, spellId)
226225
end

0 commit comments

Comments
 (0)