Page 1 of 1

(fixed) Weird trigger bug

Posted: Sat Jan 30, 2010 1:51 pm
by Joramun
For some reason "opby_class" doesn't work in the following situation:
A trigger inside a wall, an alcove, when putting the right item in the alcove.
I use that because I want to use "const_weight" and alcoves don't have this option.

I looked in the base code and did not find the reason.
I carefully checked, compiled and tried to modify the situation. It works with :
opby="waterskin"
but not with:
opby_class="WATERSKIN"

Re: (fixed) Weird trigger bug

Posted: Sat Jan 30, 2010 8:14 pm
by Sophia
I don't know how this one managed to survive for so long. :shock:

Around line 421 of triggers.lua, replace this:

Code: Select all

if (thing_arch.class == obj[exvar[id].opby_class]) then
with:

Code: Select all

if (thing_arch.class == exvar[id].opby_class) then

Re: (fixed) Weird trigger bug

Posted: Sat Jan 30, 2010 8:24 pm
by Joramun
Bleh, i didn't even see it.

Re: (fixed) Weird trigger bug

Posted: Sat Jan 30, 2010 10:39 pm
by ian_scho
There are two more references to this 'obj' object in the lines above the code. It also appears in the blocker_no_monsters function. Is it some kind of magic über object that exists globally?!

Re: (fixed) Weird trigger bug

Posted: Sun Jan 31, 2010 12:39 am
by Sophia
obj is just the table of all objects, as defined in objects.lua.
For any arch name, obj[arch_name] is just a reference to its table entry.

So yes, I guess it kind of is. :P

Re: (fixed) Weird trigger bug

Posted: Sun Jan 31, 2010 8:48 am
by ian_scho
<The sound of the palm slapping a forehead> Doh! Oh I knew that. gfx is for graphics and snd is for sound, etc. Thanks!