----------
> From: Rasdan <rasdan@PEAK.ORG>
> To: CIRCLE@post.queensu.ca
> Subject: Re: Various cool Problems !
> Date: Tuesday, September 02, 1997 2:34 PM
>
> > >> int counter;
> > >> ~~~cut
> > >> if (get_hit(ch) <50 && counter <1)
> > and here i load in the mob
> > >> counter = 1;
> > then i set counter = 1 so it wont go into this if the next time ??
> >
> > >> Understand my thoughts ?! how do i make so that it only will jump
into this
> > >> if thingy once, ie only loads the mob once ??
> > >>
> > >Just make a char flag that is set when the mob is loaded, if this flag
is
> > >set, don't load:
> >
> > hmm, feels like stoopid to do a new flag for just this thing
> > aint there a way to do the counter
> > so if counter = 1 it wont do it ?
>
> No it won't, because each time the function is called, it will reset the
> counter variable, can't have that. A char flag is the best way to do it,
> and there are a lot of them. Besides, if you run out of them, you can
> always add more. I have added 4 new sets of aff_flags, it's not hard. :)
>
Hmm...heard of the keyword "static"? Will cure that problem real
quick and then you can keep the resources of using a flag open.
Franco Gasperino
Cutting Edge Communications
http://www.cet.com/
awe@cet.com
509-444-INET
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST