(fixed) Odd code

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

(fixed) Odd code

Post 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...
Friends don't let friends eat worm round
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Odd code

Post by Sophia »

This is probably a bug! I'll look into it. :)
Post Reply