diff --git a/lib/world/obj/1.obj b/lib/world/obj/1.obj index b77e079..57c074a 100644 --- a/lib/world/obj/1.obj +++ b/lib/world/obj/1.obj @@ -482,7 +482,7 @@ carry. 10 0 0 0 1 40 0 0 0 #153 -backpack jozhal hide~ +backpack pack jozhal hide~ a jozhal-hide backpack~ A backpack made out of jozhal hide is lying here.~ This backpack has been made out of several pieces of jozhal hide. Sewn @@ -554,4 +554,25 @@ though some are lighter than others. 11 0 0 0 0 ac 0 0 0 0 0 0 0 0 0 0 0 1 40 0 0 0 +#160 +waterskin skin~ +a waterskin~ +A simple waterskin is lying here.~ + Made of some sort of animal hide, the pieces have been sewn tightly together +to form a receptacle that can hold water. +~ +17 0 0 0 0 ap 0 0 0 0 0 0 0 +4 4 0 0 +1 40 0 0 0 +#161 +waterpouch pouch leather~ +a leather waterpouch~ +A leather waterpouch has been left here.~ + Formed out of a few pieces of cheap leather that have been sewn tightly +together, this waterpouch has a small opening on one side which can be capped to +prevent water spilling out. +~ +17 0 0 0 0 ap 0 0 0 0 0 0 0 +4 4 0 0 +1 40 0 0 0 $~ diff --git a/src/act.other.c b/src/act.other.c index 3403e21..1b8253a 100644 --- a/src/act.other.c +++ b/src/act.other.c @@ -82,12 +82,9 @@ ACMD(do_quit) send_to_char(ch, "You step out-of-character and leave the world...\r\n"); - /* We used to check here for duping attempts, but we may as well do it right - * in extract_char(), since there is no check if a player rents out and it - * can leave them in an equally screwy situation. */ - - if (CONFIG_FREE_RENT) - Crash_rentsave(ch, 0); + /* Save character and objects */ + save_char(ch); + Crash_rentsave(ch, 0); /* Requirement: respawn in the same (possibly non-QUIT) room. */ GET_LOADROOM(ch) = GET_ROOM_VNUM(IN_ROOM(ch)); @@ -112,12 +109,9 @@ ACMD(do_quit) send_to_char(ch, "Goodbye, friend.. Come back soon!\r\n"); - /* We used to check here for duping attempts, but we may as well do it right - * in extract_char(), since there is no check if a player rents out and it - * can leave them in an equally screwy situation. */ - - if (CONFIG_FREE_RENT) - Crash_rentsave(ch, 0); + /* Save character and objects */ + save_char(ch); + Crash_rentsave(ch, 0); /* Requirement: respawn in the same QUIT room they logged out in. */ GET_LOADROOM(ch) = GET_ROOM_VNUM(IN_ROOM(ch)); @@ -129,6 +123,7 @@ ACMD(do_quit) ch->desc->snoop_by = NULL; } + SET_BIT_AR(PLR_FLAGS(ch), PLR_QUITING); extract_char(ch); /* Char is saved before extracting. */ } } diff --git a/src/handler.c b/src/handler.c index 13ac0f9..401c5cd 100644 --- a/src/handler.c +++ b/src/handler.c @@ -912,17 +912,20 @@ void extract_char_final(struct char_data *ch) if (GROUP(ch)) leave_group(ch); - /* transfer objects to room, if any */ - while (ch->carrying) { - obj = ch->carrying; - obj_from_char(obj); - obj_to_room(obj, IN_ROOM(ch)); - } + /* Only drop items for NPCs or players not quitting cleanly. */ + if (IS_NPC(ch) || !PLR_FLAGGED(ch, PLR_QUITING)) { + /* transfer objects to room, if any */ + while (ch->carrying) { + obj = ch->carrying; + obj_from_char(obj); + obj_to_room(obj, IN_ROOM(ch)); + } - /* transfer equipment to room, if any */ - for (i = 0; i < NUM_WEARS; i++) - if (GET_EQ(ch, i)) - obj_to_room(unequip_char(ch, i), IN_ROOM(ch)); + /* transfer equipment to room, if any */ + for (i = 0; i < NUM_WEARS; i++) + if (GET_EQ(ch, i)) + obj_to_room(unequip_char(ch, i), IN_ROOM(ch)); + } if (FIGHTING(ch)) stop_fighting(ch); @@ -962,6 +965,7 @@ void extract_char_final(struct char_data *ch) } else { save_char(ch); Crash_delete_crashfile(ch); + REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_QUITING); } /* If there's a descriptor, they're in the menu now. */ diff --git a/src/objsave.c b/src/objsave.c index 25d717a..683b051 100644 --- a/src/objsave.c +++ b/src/objsave.c @@ -485,8 +485,8 @@ void Crash_crashsave(struct char_data *ch) if (!(fp = fopen(buf, "w"))) return; - if (!objsave_write_rentcode(fp, RENT_CRASH, 0, ch)) - return; + /* Skip rent header logic — just write directly. */ + fprintf(fp, "Crashsave for %s\n", GET_NAME(ch)); for (j = 0; j < NUM_WEARS; j++) if (GET_EQ(ch, j)) { diff --git a/src/structs.h b/src/structs.h index f8cf8df..89635a6 100644 --- a/src/structs.h +++ b/src/structs.h @@ -213,6 +213,7 @@ #define PLR_BUG 17 /**< Player is writing a bug */ #define PLR_IDEA 18 /**< Player is writing an idea */ #define PLR_TYPO 19 /**< Player is writing a typo */ +#define PLR_QUITING 20 /**< Player is quitting cleanly */ /* Mobile flags: used by char_data.char_specials.act */ #define MOB_SPEC 0 /**< Mob has a callable spec-proc */