ToME: the Tales of Maj'Eyal http://forums.te4.org/ |
|
possible bug in Combat.lua... http://forums.te4.org/viewtopic.php?f=42&t=48322 |
Page 1 of 1 |
Author: | jenx [ Tue Oct 10, 2017 2:17 pm ] |
Post subject: | possible bug in Combat.lua... |
not sure if the line in here which is Code: if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end should be Code: if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam.dam) end Code: if type(dam) == "number" then if dam > 0 then dr = math.min(dam, fa) print("[ATTACK]\ttarget on_melee_hit:", dam, typ, "vs", fa) dam = dam - dr if dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end if dr > 0 and pct > 0 then dr = math.floor(dr*pct/100) if dr > 0 then print("[ATTACK]\ttarget on_melee_hit", dr, typ, "reflected") DT.projector(self, target.x, target.y, typ, dr) end end end elseif dam.dam and dam.dam > 0 then dr = math.min(dam.dam, fa) print("[ATTACK]\ttarget on_melee_hit:", dam.dam, typ, "vs", fa) if dr > 0 then dam = table.clone(dam); dam.dam = dam.dam - dr end if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end if dr > 0 and pct > 0 then dr = math.floor(dr*pct/100) if dr > 0 then print("[ATTACK]\ttarget on_melee_hit", dr, typ, "reflected") dam.dam = dr -- only change dam DT.projector(self, target.x, target.y, typ, dam) end end end can a table, in this case, dam, be passed to the default projector? I don't think so... I picked this up working on my addon Verbose. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |