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
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jun 15, 2008 7:20 pm   

[2.27] Bug - #PRINT stops the parsing of triggers
 
This was taken from http://forums.zuggsoft.com/forums/viewtopic.php?t=30906

DeReP stated that #PRINT stops his triggers from firing, and I'm just confirming it here.

Here is a simple test:

1. On the command line, type #TRIGGER {This is a test.} {#SAY Fired!}
2. On the command line, type #PRINT Testing.
3. On the command line, type #SAY This is a test.
4. On the command line, type #PRINT Testing two.
5. On the command line, type #SAY This is a test.

The output is as follows:

Testing.
This is a test.
Testing two.
This is a test.
Fired!

As you can see, it does not fire for the first instance. My guess is while #PRINT tells CMUD not to fire any triggers, it stops triggers altogether. This can have very bad side effects.

Charneus


Last edited by charneus on Sun Jun 15, 2008 9:17 pm; edited 1 time in total
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sun Jun 15, 2008 8:25 pm   
 
But seems to turn it back on after a second usage?? Is it maybe toggling it instead of explicitly turning it off, then turning it back on when finished?
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Sun Jun 15, 2008 9:18 pm   
 
Im glad Im not the only one on this. Thanks Charneus.
I think the aproach on the #print command is very risky alltogether, disabling / enabling triggers should happen when outputing anything to windows. That string should have another property that triggers wont look into instead.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jun 15, 2008 9:24 pm   
 
The approach isn't risky. It's just a bit faulty. Some people rely on #SAY, #SHOW, and #ECHO as triggers (the only difference between them being #ECHO sends it to the top window).

#PRINT was requested to do exactly as it does now. The only problem is it fails to turn parsing back on for the triggers. Other than that, I think it's a great command addition - that way I can #PRINT output to my screen without worrying if it's going to set off a trigger.

Charneus
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Jun 16, 2008 6:12 pm   
 
Zugg, any chance this will be fixed in a very near future version? Maybe 2.27b?

Charneus
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jun 16, 2008 7:02 pm   
 
Bah, yes this was a stupid bug. I had code like this:
Code:
        B := Pref.EchoMessage;
        Pref.EchoMessage := true;
        B1 := NoTrigger;
        NoTrigger := true;
        EchoInfo( Params);
        NoTrigger := B;
        Pref.EchoMessage := B1;

Notice the bug? I flipped B and B1 when restoring the variables that are used to handle whether triggers are enabled. Yeah, that's what I get for not picking better variable names.

It's fixed for the next version, whether it's 2.27a or 2.28. Still deciding.
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