Page 1 of 1

(fixed) Lua error in poison_impact

Posted: Tue Dec 07, 2010 3:05 pm
by money
hmm.... I got an error using latest version on level 4, against a swamp slime monster - was punching him... and when he shot some slime all closed and error presented:

Lua Function poison_slime.on_impact: base/damage.lua:377: attempt to perform arithmetic on local 'range' (a nil value)

Re: (fixed) Lua error in poison_impact

Posted: Tue Dec 07, 2010 8:03 pm
by Sophia
Oops. Fixed now. :)

If you want to keep playing, you can fix this yourself, too:
Around line 377 of damage.lua you'll find a function called poison_impact. However, immediately above that, you'll find another shorter function called poison_impact, taking less parameters. Two functions with the same name is what is creating the problem.
Change this line:

Code: Select all

function poison_impact(hit_ppos, poi)
to this:

Code: Select all

function player_poison_impact(hit_ppos, poi)
Then, lower down, early in the second poison_impact, look for some code that looks like:

Code: Select all

if (hit_ppos) then
   poison_impact(hit_ppos, poi)
end
and change that to:

Code: Select all

if (hit_ppos) then
   player_poison_impact(hit_ppos, poi)
end
Everything will work wonderfully, then. :mrgreen:

Re: (fixed) Lua error in poison_impact

Posted: Tue Dec 07, 2010 8:45 pm
by money
Thanks :)

Re: (fixed) Lua error in poison_impact

Posted: Sat Dec 18, 2010 4:41 am
by Gambit37
This is so cool that simple bugs can be fixed locally by us!