Hotboot, duplicate corpse items

Posted by Zeno on Sat 02 Oct 2004 05:52 AM — 11 posts, 34,786 views.

USA #0
Seems that everytime I hotboot, it duplicates items in a corpse?

Quote:
Tarnoth chats 'umm i kinda need a imms help all the changes tripled the stuff on my corpse ;( and now i have two exta dragon arms that i cant drop'


Its true, had to check it myself. No idea what to look for. Anyone know?
Canada #1
Are you using Samson's hotboot? If so, you may have missed the step that stops writing corpses, and then you get multiple ones.
USA #2
Yeah I am. Don't think I missed any steps. One second.

[EDIT] Checked the snippet intructions, I didn't miss anything to do with corpses in save.c, and I don't think I missed anything at all. As I said, corpses are fine, but items in the corpse are not.


    if ( obj->prev_content && os_type != OS_CORPSE )
        if( os_type == OS_CARRY )
           fwrite_obj( ch, obj->prev_content, fp, iNest, OS_CARRY, hotboot );
Amended on Sat 02 Oct 2004 04:20 PM by Zeno
USA #3
YOu should have had a step which told you to do this:

Quote:

Then locate this segment:

/* Corpse saving. -- Altrag */
fprintf( fp, (os_type == OS_CORPSE ? "#CORPSE\n" : "#OBJECT\n") );

Directly ABOVE that, add this:

/* DO NOT save corpses lying on the ground as a hotboot item, they already saved elsewhere! - Samson */
if( hotboot && obj->item_type == ITEM_CORPSE_PC )
return;


That is what stops a hotboot from saving a corpse since corpses are already saved in another section.
USA #4
Yeah. Already in.

    /*    Munch magic flagged containers for now - bandaid */
    if ( obj->item_type == ITEM_CONTAINER
    &&   IS_OBJ_STAT( obj, ITEM_MAGIC ) )
        xTOGGLE_BIT( obj->extra_flags, ITEM_MAGIC );

    /* DO NOT save corpses lying on the ground as a hotboot item, they already saved elsewhere! $
    if( hotboot && obj->item_type == ITEM_CORPSE_PC )
        return;

    /* Corpse saving. -- Altrag */
    fprintf( fp, (os_type == OS_CORPSE ? "#CORPSE\n" : "#OBJECT\n") );

    if ( iNest )
Canada #5
Can you confirm that this didn't happen before you put hotboot? It may be a problem with the corpse code, unlikely, but possible.
USA #6
Hmmmm. Yes, I believe it was fine pre-hotboot. I didn't put in hotboot until a while after I started the MUD.
Canada #7
Hmmm, well from the little code thats here it looks like everything should be good. You might want to try booting in gdb, putting a break on something that will specifically target the items in the corpse so you can get the memory adress of the corpse. You can then remove that break, and put a conditional break in fwrite_obj, checking that the object equals the memory adress you got before. You could also set up a conditional check to check the name of the items. That may give you some more info, you would be able to find out where its being written from, and narrow your search down a little.
USA #8
Hmm it's still happening of course. There was one shard in the corpse:
[ 2681] Derius: Sat Mar  5 07:23:50 2005 :: Derius(0) got a purified shard from in corpse Derius(11) in room 2681.
(hotboot)
[ 2681] Derius: Sat Mar  5 08:11:11 2005 :: Derius(0) got a purified shard from in corpse Derius(11) in room 2681.


I compared write_corpses to current SmaugFUSS, no difference. Calls to fwrite_obj also have no difference.
[EDIT] Just checked the function fwrite_obj, no difference.
(besides what object fields I have added)

Also I cannot reproduce this every time.
Amended on Sat 05 Mar 2005 03:49 PM by Zeno
USA #9
I had this problem a bit ago.. it fixed itself and went on to a different section.. for me its now happening to lockers.
USA #10
How did you fix it?