Re: Load room for players.

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

>From: Moppe Sewerin <>
>Reply-To: Circle Discussion List <>

>When my players rent, they don't end up in the room they rented. They
>end up in the starting room for mortals. This is really annoying =). I'm
>using Circle bpl19. Any1 who think they could help me with this?

I can explain the problem to you and give a solution, but I don't know if
its the best solution.

The problem is, in objsave.c when a player rents, that player's loadroom
becomes the room he is in, but when extract_char() is called, that player
gets saved again, but this time, in NOWHERE.

Here is my fix. In db.c:

void save_char(struct char_data *ch, room_rnum load_room)
  struct char_file_u st;

  if (IS_NPC(ch) || !ch->desc || GET_PFILEPOS(ch) < 0)

  char_to_store(ch, &st);

  strncpy(, ch->desc->host, HOST_LENGTH);[HOST_LENGTH] = '\0';

-    if (load_room == NOWHERE)
-      st.player_specials_saved.load_room = NOWHERE;
-    else
-      st.player_specials_saved.load_room = GET_ROOM_VNUM(load_room);
-  }
+  if (!PLR_FLAGGED(ch, PLR_LOADROOM) && load_room != NOWHERE)
+    st.player_specials_saved.load_room = GET_ROOM_VNUM(load_room);

  fseek(player_fl, GET_PFILEPOS(ch) * sizeof(struct char_file_u), SEEK_SET);
  fwrite(&st, sizeof(struct char_file_u), 1, player_fl);

Then, in your other commands where they leave the game, you put in stuff
In act.other.c: do_quit():
    if (free_rent)
      Crash_rentsave(ch, 0);

    extract_char(ch);           /* Char is saved in extract char */

+    /* Char return to mortal_start_room on login */
    /* If someone is quitting in their house, let them load back here */
    if (ROOM_FLAGGED(loadroom, ROOM_HOUSE))
      save_char(ch, loadroom);

In objsave.c: gen_receptionist():

    mudlog(buf, NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE);
    act("$n helps $N into $S private chamber.", FALSE, recep, 0, ch,
    save_room = ch->in_room;
    save_char(ch, save_room);
+    /* This allows player to reload in INN if re-enter game. */
+      GET_LOADROOM(ch) = GET_ROOM_VNUM(save_room);
  } else {
    Crash_offer_rent(ch, recep, TRUE, mode);
    act("$N gives $n an offer.", FALSE, ch, 0, recep, TO_ROOM);

There is one other way they can leave the game - dying. You can set their
loadroom to NOWHERE if you want.

Get your FREE download of MSN Explorer at

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

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