Re: Prompt

From: Chris Gilbert (chris@buzzbee.freeserve.co.uk)
Date: 02/15/00


Mike Fisher wrote:
>
> I am having a problem with my prompt.   It doesn't show up unless I type in
> a command, below is the code.
>
> Code:
> char *make_prompt(struct descriptor_data *d)
> {
>   static char prompt[256];
>
>   if (d->showstr_count)
>     sprintf(prompt,"\r[ Return to continue, (q)uit, (r)efresh, (b)ack, or
> page number (%d/%d) ]",
>     d->showstr_page, d->showstr_count);
>
>     else if (STATE(d) == CON_PLAYING && !IS_NPC(d->character))
>     write_to_descriptor(d->descriptor, prompt_str(d->character));
>      else
>      *prompt = '\0';
>
>   return prompt;
> }

Have you looked at what stock circle does?  what does prompt_str do?
Why are you using write_to_descriptor here?

Notice that there's a static buffer called prompt?  notice that it
returns a pointer to this buffer

Now where is make_prompt found, ooh it's in game_loop:
write_to_descriptor(d->descriptor, make_prompt(d));

So we write the contents of the buffer returned by make prompt to the
descriptor.... perhaps you've got something broken there?

Chris


     +------------------------------------------------------------+
     | 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 : 04/10/01 PDT