backstr with improved-editor for oasis

From: Kras Kresh (
Date: 03/20/02

With the improved-editor for olc added in, one cannot notice how writing the
the description for the player hasn't changed. Well, I noticed anyway. Once
the player hits '2' in the main menu, he/she will be able to modify, or
rather completely rewrite, the description.

My solution was to use the d->backstr. My mud version is 19-20.

void nanny():
      SEND_TO_Q("Enter the new text you'd like others to see when they look
at you.\r\n", d);
      SEND_TO_Q("Type '/s' when done.  Type '/h' for help.\r\n", d);
+      d->backstr = str_dup(d->character->player.description);
      d->str = &d->character->player.description;
      d->max_str = EXDSCR_LENGTH;
      STATE(d) = CON_EXDESC;

void close_socket():
    /* Plug memory leak, from Eric Green. */
    if (PLR_FLAGGED(d->character, PLR_MAILING) && d->str) {
      if (*(d->str))
+    else if (!PLR_FLAGGED(d->character, PLR_WRITING) && d->backstr)
+      free(d->backstr);      /* editing description ... not olc */

Be sure to thoroughly test this first.

MSN Photos is the easiest way to share and print your photos:

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT