Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Oct 25, 2008 6:06 pm   

[2.36 Lua] Disabled objects are not returned by gettrigger
 
When an object's disabled, gettrigger can't return it. Import this XML:

Code:
<alias name="test" language="Lua" id="1">
<value>print(zs.gettrigger("test"))
print(zs.gettrigger("test").name)
print(zs.gettrigger("test").fullname)
print(zs.gettrigger("test").isvalid)
zs.gettrigger("test").enabled=0
print(zs.gettrigger("test"))
print(zs.gettrigger("test").name)
print(zs.gettrigger("test").fullname)
print(zs.gettrigger("test").isvalid)</value>
</alias>
<trigger name="test" priority="20" id="2">
  <pattern>blash</pattern>
  <value>tdbhsfh</value>
</trigger>


And then run the test alias from the command line. You'll see

Quote:
Object(Trigger:test)
test
blash
tdbhsfh
false
Object(invalid)
nil
nil
true


When the two returns should be the same. A side-effect of this is that it's impossible to use the enabled flag to turn a disabled trigger on when you're referring to that trigger by name.

This same bug doesn't seem to apply if you put the trigger object in a variable, so the issue is gettrigger not returning disabled triggers. I assume it's the same for the other getxxxx functions too.

Also, I'm not sure why isvalid is returning false in the first instance and true in the second.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Oct 27, 2008 4:35 pm   
 
Added to bug list.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net