possible bug in Combat.lua...

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

possible bug in Combat.lua...

#1 Post by jenx »

not sure if the line in here which is

Code: Select all

if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end
should be

Code: Select all

if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam.dam) end

Code: Select all

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.
MADNESS rocks

Post Reply