OLC Redit Fix

From: nate (wintersn.geo@yahoo.com)
Date: 11/05/00


This has been a problem haunting The Builder's Academy the past couple
weeks. Gave some really strange errors and crashes. Now that we're starting
to grow and have more than 10 builders logged in at once we realized that
editing a room with more than one person in it was causing these problems.
So our head coder, Zemial, added the following. Figured there would be
plenty of others out there that could use this.

--

We all know how you keep getting output from a room you were in when someone
started editing it,
and it will crash your mud if you go to that room. We had already made a fix
for this, however
it was insufficient to say the least, so we worked on it a bit more and came
up with this solution.

What happens is this:

A builder starts to edit a room, every other player in the room being edited
is kicked to his/her
start room, preventing people from getting the bad output. This fix should
be followed up by another snip of code preventing anyone entering a room
being edited, since that might cause other crashes.

NOTE: that Mobs do not get moved, OLC already handles them. Just not
handling players properly, well until now that is.

This code was done by: Zemial of Cruel World MUD & The Builders Academy to
avoid all those random crashes.

email: zemial@cruelworld.dune.net
No credits needed


In oasis.c Add:

#include "handler.h"

/*
 * External variables  Added by Zemial
 */
extern room_rnum r_mortal_start_room;
extern room_rnum r_immort_start_room;

in ACMD(do_oasis) Add:
struct char_data *vict, *tmp_ch;


Now look for:
  /*
   * Steal player's descriptor and start up subcommands.
   */


Change:
case SCMD_OASIS_REDIT:
   if ((real_num = real_room(number)) >= 0)
      redit_setup_existing(d, real_num);
   else
      redit_setup_new(d);
   STATE(d) = CON_REDIT;
   break;

To:
case SCMD_OASIS_REDIT:
   if ((real_num = real_room(number)) >= 0) {
      vict = world[real_num].people;

      while (vict) {
         tmp_ch = vict->next_in_room;

         if ((GET_LEVEL(vict) < LVL_IMMORT) && (vict != ch) &&
!IS_NPC(vict)) {
            char_from_room(vict);
            char_to_room(vict, r_mortal_start_room);
            send_to_char("Powerful magic transports you elsewhere!\r\n",
vict);
         } else if ((vict != ch) && !IS_NPC(vict)) {
            char_from_room(vict);
            char_to_room(vict, r_immort_start_room);
            send_to_char("You feel relocated as this place is being
changed!\r\n", vict);
         }

         vict = tmp_ch;
      }

      redit_setup_existing(d, real_num);
   } else
      redit_setup_new(d);
   STATE(d) = CON_REDIT;
   break;

---

That's it, hope this helps some people.


Rumble

The Builders Academy
cruelworld.dune.net  Port: 9091



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


     +------------------------------------------------------------+
     | 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/11/01 PDT