Re: [CODE] Hiding Levels

From: Sammy (Samedi@cris.com)
Date: 01/23/97


On Thu, 23 Jan 1997, Brian Guilbault wrote:

- I have a question that I guess it more of a C question that I haven't
- been able to figure out. I have been hiding levels from other 
- characters in the who list and group list and all those fun places.
- I have decided what I want to do is show levels to ehm, but give
- the option of an "anonymous" command which will show " -- " for
- their level if they have it on. I got the command working fine, but
- here's my problem.

You could change the sprintf placeholder from %d (or %i if that's what's
there) to %s, and change the argument to something like this:

PLR_FLAGGED(tch, PLR_ANONYMOUS) ? "--" : itoa(GET_LEVEL(tch))

itoa converts int to char array (string) and basically does the same thing
as the %d conversion routine in sprintf, so you're not adding any extra
processory munching other than the if check embedded in the argument.

Sam


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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