Re: DG Scripts Bug

From: Chris Jacobson (fear@technologist.com)
Date: 12/21/99


On 12/21/99 6:05 PM, Brandon Phelps (brando@empyrial.com) stated:

Since I wrote the switch and while handlers, Ifeel compelled to point
out, those cases will fall through without break'ing them...  Just like
in C... unless the DGScript maintainer didn't add my snippet verbatim.
In any case, I recommend adding breaks in there.

>wait 120 s
>* Pick a random number
>eval gotoroom %random.6%
>eval saymsg %random.6%
>* Control the mob
>switch %saymsg%
>  case 1
>    say Well, Its dinner time, gotta go!
>  case 2
>    say Oops! I almost forgot lunch, cya later!
>  case 3
>    fart
>    say Ewwww, it stinks in here, I'm leaving!
>  case 4
>    say The big game is on in 5 minutes, gotta fly!
>  case 5
>    say I'm tired, I think I'll hit the sack early today.
>  case 6
>    say My beeper is going off, I'd better go.
>done
>mecho %self.name% disappears through spiraling blue flames!
>switch %gotoroom%
>  case 1
>    mgoto 3001
>  case 2
>    mgoto 3001
>  case 3
>    mgoto 3019
>  case 4
>    mgoto 3023
>  case 5
>    mgoto 3029
>  case 6
>    mgoto 3033
>done
>mecho %self.name% appears through spiraling blue flames!


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST