void raw_kill(struct char_data * ch, struct char_data * killer)
{
if (FIGHTING(ch))
stop_fighting(ch);
while (ch->affected)
affect_remove(ch, ch->affected);
/* To make ordinary commands work in scripts. welcor*/
GET_POS(ch) = POS_STANDING;
if (killer) {
if (death_mtrigger(ch, killer))
death_cry(ch);
} else
death_cry(ch);
if (killer)
autoquest_trigger_check(killer, ch, NULL, AQ_MOB_KILL);
update_pos(ch);
make_corpse(ch);
extract_char(ch);
if (killer) {
autoquest_trigger_check(killer, NULL, NULL, AQ_MOB_SAVE);
autoquest_trigger_check(killer, NULL, NULL, AQ_ROOM_CLEAR);
}
}
/* transfer character's inventory to the corpse */
corpse->contains = ch->carrying;
for (o = corpse->contains; o != NULL; o = o->next_content)
o->in_obj = corpse; // when you do this you do begin to have fields that makes no sense (obj can be in inentory and wear as well
object_list_new_owner(corpse, NULL); // maybe this is to fix what is above but we have no idea
/* transfer character's equipment to the corpse */ //this is only needed because you did not do it when you shoudl have (ie, above)
for (i = 0; i < NUM_WEARS; i++)
if (GET_EQ(ch, i)) {
remove_otrigger(GET_EQ(ch, i), ch);
obj_to_obj(unequip_char(ch, i), corpse);
}
OBJ_DATA *obj, *obj_next;
for (obj = ch->carrying;obj ;obj = obj_next) {
obj_next = obj->next_content;
obj_from_char(obj); //this is what does all the unequip etc etc etc and ensure the player does not have anything left referenced to the object
if (IS_SET(obj->extra_flags,ITEM_ROT_DEATH)) {
obj->timer = number_range(5, 10);
REMOVE_BIT(obj->extra_flags,ITEM_ROT_DEATH);
}
REMOVE_BIT(obj->extra_flags,ITEM_VIS_DEATH);
if (IS_SET( obj->extra_flags, ITEM_INVENTORY )) {
extract_obj(obj);
continue;
}
obj_to_obj(obj, corpse); //put the object in the corpse
}
I'm running into an issue were when a player is killed the players equipment is left on, its copied into his corpse, copied to the room, but he's left wearing it also.
I believe its something to do when its making the corpse or extracting the character. I've looked over it for hours and cannot spot it. Maybe more pairs of eyes can.
extract char_final.