06 Nov, 2011, Hades_Kane wrote in the 1st comment:
Votes: 0
Because of some code changes, I found a slight bug in the ROM make_corpse function… Under normal circumstances, this probably won't show any ill affects for others, but I thought I'd point it out anyhow.

Where you have this in fight.c in the make_corpse function:

if (IS_SET (obj->extra_flags, ITEM_INVENTORY))
extract_obj (obj);


It should be:

if ( IS_SET( obj->extra_flags, ITEM_INVENTORY ) )
{
extract_obj( obj );
continue;
}


It seems that without that continue, it didn't seem to be properly extracting and that had caused me a few problems.
06 Nov, 2011, Rarva.Riendf wrote in the 2nd comment:
Votes: 0
I confirm I have a continue there as well
OBJ_DATA *obj, *obj_next;
for (obj = ch->carrying;obj ;obj = obj_next) {
obj_next = obj->next_content;
obj_from_char(obj);
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);
}
06 Nov, 2011, Tyche wrote in the 3rd comment:
Votes: 0
I can't find this bug in the actual ROM code. Including 'continue' would be completely unnecessary.

for ( obj = ch->carrying; obj != NULL; obj = obj_next )
{
bool floating = FALSE;

obj_next = obj->next_content;
if (obj->wear_loc == WEAR_FLOAT)
floating = TRUE;
obj_from_char( obj );
if (obj->item_type == ITEM_POTION)
obj->timer = number_range(500,1000);
if (obj->item_type == ITEM_SCROLL)
obj->timer = number_range(1000,2500);
if (IS_SET(obj->extra_flags,ITEM_ROT_DEATH) && !floating)
{
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 );
else if (floating)
{
if (IS_OBJ_STAT(obj,ITEM_ROT_DEATH)) /* get rid of it! */
{
if (obj->contains != NULL)
{
OBJ_DATA *in, *in_next;

act("$p evaporates,scattering its contents.",
ch,obj,NULL,TO_ROOM);
for (in = obj->contains; in != NULL; in = in_next)
{
in_next = in->next_content;
obj_from_obj(in);
obj_to_room(in,ch->in_room);
}
}
else
act("$p evaporates.",
ch,obj,NULL,TO_ROOM);
extract_obj(obj);
}
else
{
act("$p falls to the floor.",ch,obj,NULL,TO_ROOM);
obj_to_room(obj,ch->in_room);
}
}
else
obj_to_obj( obj, corpse );
}
06 Nov, 2011, Rarva.Riendf wrote in the 4th comment:
Votes: 0
He probably did as I did, moved all the item scattering on the ground to the extract method.
but then forgot the continue as otherwise the obj_to_obj( obj, corpse ); will put an invalid item in the corpse as it was extracted.
06 Nov, 2011, Tyche wrote in the 5th comment:
Votes: 0
Probably deleted the original 'else' clause, which seems to be present in all the ROM and Merc versions.
Just confirming that it's an introduced bug and I don't have to care about it in Murk++ either.

ObjIter o, onext;
for (o = ch->carrying.begin(); o != ch->carrying.end(); o = onext) {
obj = *o;
onext = ++o;
obj->obj_from_char();
if (IS_SET (obj->extra_flags, ITEM_INVENTORY))
obj->extract_obj ();
else
obj->obj_to_obj(corpse);
}
07 Nov, 2011, Hades_Kane wrote in the 6th comment:
Votes: 0
Yeah, that else was commented out when I removed floating items… I see that now.

Disregard this then! :p
0.0/6