(fixed) lua crash

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
User avatar
Kain
Apprentice
Posts: 50
Joined: Wed Mar 14, 2007 4:42 am

(fixed) lua crash

Post by Kain »

happened while tossing some death knight parts around.. but it mentions torch. I had a torch held in left hand of lead character.

INIT: Parsing configuration file
INIT: Using gamedir test_dungeon (base:0)
INIT: Using color depth of 32
INIT: Starting FMOD
INIT: Setting up triple buffer
LUA: Lua initialized
Parsing base/global.lua
Parsing base/graphics.lua
Parsing base/util.lua
Parsing base/triggers.lua
Parsing base/conditions.lua
Parsing base/monster.lua
Parsing base/methods.lua
Parsing base/damage.lua
Parsing base/xp.lua
Parsing base/magic.lua
Parsing base/msg_handlers.lua
Parsing base/system.lua
Parsing base/startup.lua
Parsing test_dungeon/startup.lua
Parsing base/objects.lua
OBJ: 395 system archs
Parsing test_dungeon/objects.lua
OBJ: 398 total archs
Parsing test_dungeon/dungeon.lua
LUA ERROR: Lua Function torch_3.msg_handler[256]: base/util.lua:492: attempt to perform arithmetic on field 'def_charge' (a nil value)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Fixed!

It's actually a one-line fix, in case anyone wants to fix their own copy before 0.15 is released.
Find the function torch_value in base/util.lua and look for the line:

Code: Select all

if (arch.class ~= "TORCH") then return 0 end
Immediately after that line, add:

Code: Select all

if (not arch.def_charge) then return 0 end
Post Reply