Page 1 of 1

(fixed) Odd code

Posted: Wed Aug 17, 2016 3:15 am
by kaypy
Hi

I was poking around the base code and stumbled over this:
monster.lua ~ line 256 wrote:

Code: Select all

function monster_poisonattack(arch, id, targppos, targchar, t_damage, c_damage)
	local poison = arch.poison
	if (not poison) then poison = 1 end
	poison_character(targchar, arch.poison)
	return nil
end
After getting arch.poison and making sure it isn't zero, the code goes back and uses the original value anyway. There's no normal way for a monster_poisonattack without having arch.poison set, but if the zero check is there it presumably ought to be used...

Re: Odd code

Posted: Wed Aug 17, 2016 6:56 am
by Sophia
This is probably a bug! I'll look into it. :)