Yet another little issue that's been popping up for me. I have been able to remove the level restrictions on weapons and armor for my players, but sometimes, if they have a weapon equipped that is of a higher level than they are, it is deleted from their inventory when they quit - even after saving. I have looked everywhere I can think of in the code for this reference, but I'm really not sure exactly what to look for.
Any ideas?
EDIT - I also seem to have a key that won't save either - it disappears from inventory every time I re-log.
In your last topic "Old subject, but I'm in need of assistance (weapon levels in shops)", you asked where to find the part that removed items that were above their level, and I told you to look for a certain ifcheck. Then you said you found it. Did it not work?
It worked for allowing players to wield weapons above their level, but every now and again, the weapons and armor get taken away when the player quits. It happened to me twice today while testing.
I will look for the key in save.c - what do I do when I get there?
Ok - I removed that check, but the key still isn't saving with the char's. Might this bit of code have something to do with the prob as well?
/*
* Un-equip character before saving to ensure proper -Thoric
* stats are saved in case of changes to or removal of EQ
*/
void de_equip_char( CHAR_DATA *ch )
{
char buf[MAX_STRING_LENGTH];
OBJ_DATA *obj;
int x,y;
for ( x = 0; x < MAX_WEAR; x++ )
for ( y = 0; y < MAX_LAYERS; y++ )
save_equipment[x][y] = NULL;
for ( obj = ch->first_carrying; obj; obj = obj->next_content )
if ( obj->wear_loc > -1 && obj->wear_loc < MAX_WEAR )
{
if ( get_trust( ch ) >= obj->level )
{
for ( x = 0; x < MAX_LAYERS; x++ )
if ( !save_equipment[obj->wear_loc][x] )
{
save_equipment[obj->wear_loc][x] = obj;
break;
}
if ( x == MAX_LAYERS )
{
sprintf( buf, "%s had on more than %d layers of clothing in one location (%d): %s",
ch->name, MAX_LAYERS, obj->wear_loc, obj->name );
bug( buf, 0 );
}
}
else
{
sprintf( buf, "%s had on %s: ch->level = %d obj->level = %d",
ch->name, obj->name,
ch->level, obj->level );
bug( buf, 0 );
}
unequip_char(ch, obj);
}
}
It seems to refer to the object level and whether it gets un-equipped at save time...
Yes. When the charachters save, *sometimes* I get the message contained in the above code:
sprintf( buf, "%s had on %s: ch->level = %d obj->level = %d",
ch->name, obj->name,
ch->level, obj->level );
and it lists the object level in contrast to the player level, and when the player logs back on, the armor they were wearing, along with any keys, is gone.