|
rck Novice
Joined: 26 Oct 2005 Posts: 32 Location: California
|
Posted: Wed Dec 19, 2007 2:35 am
[2.18] Lua bug: aliases using lua code trashes rest of state (confirmed) |
Problem identified, see next post
It appears that cMud is reinitializing all its functions on each trigger call; this seems a bit silly to do?
I test this by putting:
Code: |
zs.debug(tostring(zs.param)) |
in a trigger and having the trigger execute. Each trigger script call shows a different function pointer, implying the function is being recreated with each call.
After much use of zs.param() triggers being called will no longer be able to get params with zs.param() or zs.params() -- they return 0, I suspect this could be caused by the reinitializing.
A restart of the cMud client fixes the .param/.params functions. |
|
Last edited by rck on Thu Dec 20, 2007 12:49 am; edited 2 times in total |
|
|
|
Grizdor Newbie
Joined: 17 Dec 2007 Posts: 3
|
Posted: Wed Dec 19, 2007 8:31 pm |
I was just going to post about this myself. I think the problem is related to lua aliases. After I use an alias written in lua, calling zs.param in triggers always returns either 0 or what the parameter was in the alias.
|
|
|
|
rck Novice
Joined: 26 Oct 2005 Posts: 32 Location: California
|
Posted: Thu Dec 20, 2007 12:46 am |
Grizdor wrote: |
I was just going to post about this myself. I think the problem is related to lua aliases. After I use an alias written in lua, calling zs.param in triggers always returns either 0 or what the parameter was in the alias. |
You're right about the alias!
I had an alias, and did use Lua for it, and it instantly breaks after using it, so now I know what to avoid. That's an odd bug though, conflict in Lua state I guess? I'm guessing when the alias code is executed it trashes the rest of the Lua state. |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Thu Dec 20, 2007 2:32 am |
It appears to only trash the params for triggers.
params for functions and aliases remain functional. |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
rck Novice
Joined: 26 Oct 2005 Posts: 32 Location: California
|
Posted: Tue Jan 15, 2008 8:40 pm |
Just bumping this so it doesn't remain unfixed since it was on the 4th page :).
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jan 15, 2008 11:17 pm |
It's on the bug list. Bumping it isn't going to effect anything because I'm not going to be doing bug fixes for several weeks until I'm done porting my development tools to Vista and Delphi 2007.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Jan 15, 2008 11:39 pm |
I think it was more because you hadn't replied to the thread, and you normally do. In some respects, it's a bad habit :P
|
|
|
|
rck Novice
Joined: 26 Oct 2005 Posts: 32 Location: California
|
Posted: Thu Jan 17, 2008 12:52 am |
Fang Xianfu wrote: |
I think it was more because you hadn't replied to the thread, and you normally do. In some respects, it's a bad habit :P |
Yeah that's exactly what it was.
|
|
|
|
|
|