Fix item respawning issue

This commit is contained in:
kinther 2025-10-15 18:25:53 -07:00
parent c177ec2f95
commit 3fd48b60f6
5 changed files with 46 additions and 25 deletions

View file

@ -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
$~

View file

@ -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. */
}
}

View file

@ -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. */

View file

@ -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)) {

View file

@ -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 */