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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
rck
Novice


Joined: 26 Oct 2005
Posts: 32
Location: California

PostPosted: 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
Reply with quote
Grizdor
Newbie


Joined: 17 Dec 2007
Posts: 3

PostPosted: 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.
Reply with quote
rck
Novice


Joined: 26 Oct 2005
Posts: 32
Location: California

PostPosted: 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.
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: 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."
Reply with quote
rck
Novice


Joined: 26 Oct 2005
Posts: 32
Location: California

PostPosted: Tue Jan 15, 2008 8:40 pm   
 
Just bumping this so it doesn't remain unfixed since it was on the 4th page :).
Reply with quote
Zugg
MASTER


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

PostPosted: 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.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: 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
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
rck
Novice


Joined: 26 Oct 2005
Posts: 32
Location: California

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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