Re: [Newbie] Pre-Who Titles.

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


On Thu, 16 Jan 1997, Matthew Bergman wrote:

- Ok I'm trying to add immortal titles to the who listing (and I don't like
- the format of the new_do_who.patch) No offense Dan :)  
- Ok I've been able to do it this way, but its a pain to add new fields to
- the who listing.
- 
- --- snip ---
- switch (GET_LEVEL(tch)) {
-         case LVL_IMPL:
-         sprintf(buf, "[Implementor] %s %s", GET_NAME(tch), GET_TITLE(tch));
-         break;
- --- snip ---

How about:

In constants.c:

char *imm_titles[] =
{
  "Implementor",
  "Greater God",
  "    God    ",
  "  Immortal "
};

In do_who:

  extern char *imm_titles[];

And replace your whole switch block with this:

  if(GET_LEVEL(tch) >= LVL_IMMORT)
    sprintf(buf, "[%s] %s %s", imm_titles[LVL_IMPL - GET_LEVEL(tch),
      GET_NAME(tch), GET_TITLE(tch);

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