DPSMate
DPSMate copied to clipboard
[fix] HoT parser indexing
Resolves #236 Resolves #213
Isn't this just reverting #232 ? Merging this PR may reopen other issues like #228 and #231 .
Good point, I didn't test it with pets, but seems like you're right. I guess this issue needs more complex modification to distinct between players and pets? Unfortunately I don't really know Lua and WoW addons well enough to make this work for both cases...
Here's what I did to make the errors go away:
if amount==nil then amount=0 end
before amount
is used. I don't know if it's parsing correctly, but it's close enough for me.
#232 only fix it for a pet name of length 5 the variable k should be set to the start of the heal value when a pet is found (that's when " gains " is found) I didn't test it
function DPSMate.Parser:SpellPeriodicSelfBuff(msg)
- local i,j,k = 0,0,12
+ local i,j,k = 0,0,10
local nextword, choice;
nextword, choice, k = GetNextWord(msg, k, SPSBChoices, false)
if choice == -1 then
local debug = DPSMate.Debug and DPSMate.Debug:Store("18: Event not parsed yet => "..msg) or DPSMate:SendMessage("18: Event not parsed yet, inform Shino! => "..msg)
return
end
if choice <= 2 then
local source = Player;
local i,j = strfind(nextword, " gains ", 1, true)
if i and j then
source = strsub(nextword, 1, i-1);
nextword = strsub(nextword, j+1);
+ k = i + 7
end
It will not fix it. Wrong logic....
Closing it for now.