 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 27, 2008 4:35 pm |
Added to bug list.
|
|
|
|
 |
|
|
|