backstr with improved-editor for oasis

From: Kras Kresh (kras_kresh@hotmail.com)
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.

interpreter.c:
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;
      break;

comm.c:
void close_socket():
    /* Plug memory leak, from Eric Green. */
    if (PLR_FLAGGED(d->character, PLR_MAILING) && d->str) {
      if (*(d->str))
        free(*(d->str));
      free(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:
http://photos.msn.com/support/worldwide.aspx

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



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