Skip to content

Commit

Permalink
fix error in monster update hook
Browse files Browse the repository at this point in the history
The training hall dummy seems to not have a "SetInfo" property, so we
add a check for this to avoid crashing in the monster update hook when
in the training hall. This fixes an issue where poison and blast damage
was not being tracked in the training hall.
  • Loading branch information
coavins committed Feb 19, 2022
1 parent 024c782 commit d8904ef
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/autorun/mhrise-coavins-dps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2911,15 +2911,17 @@ local function updateBossEnemy(args)

if not boss.id then
local setInfo = enemy:call("get_SetInfo")
local id = setInfo:call("get_UniqueId")
if id then
log_info('found id ' .. id .. ' for ' .. boss.name)
if id == 0 then
id = FAKE_ATTACKER_ID
log_info('override id to ' .. id)
end
if setInfo then
local id = setInfo:call("get_UniqueId")
if id then
log_info('found id ' .. id .. ' for ' .. boss.name)
if id == 0 then
id = FAKE_ATTACKER_ID
log_info('override id to ' .. id)
end

boss.id = id
boss.id = id
end
end
end

Expand Down

0 comments on commit d8904ef

Please sign in to comment.