| Message |
After months of tracking this rare bug, I finally found what was causing it.
wear hunter
You wield a hunter's longbow.
wear demonic
Log: [*****] BUG: get_obj_weight: NULL obj!
You dual-wield a demonic sword.
The sword surges with a demonic power as Zeno wields it in his hand!
So a bow and sword.
ostat hunter
Name: hunter longbow
Vnum: 2860 Type: missileweapon Count: 38 Gcount: 1
Serial#: 426 TopIdxSerial#: 426 TopSerial#: 552
Short description: a hunter's longbow
Long description : A hunter's longbow lies here.
Wear flags : take missile
Extra flags:
Magic flags: none
Number: 1/1 Weight: 1/1 Layers: 0 Wear_loc: 21
Cost: 0 Rent: 0 Timer: 0 Level: 115
In room: 0 In object: (none) Carried by: Zeno
Index Values : 12 0 100 14 10 0.
Object Values: 12 30 91 14 10 0.
Attached shards: 0
ostat demonic
Name: demonic sword
Vnum: 2851 Type: weapon Count: 6 Gcount: 1
Serial#: 427 TopIdxSerial#: 427 TopSerial#: 564
Short description: a demonic sword
Long description : A demonic sword lies here crackling with energy.
Wear flags : take wield
Extra flags: glow hum antihuman antihanyou
Magic flags: none
Number: 1/1 Weight: 1/1 Layers: 0 Wear_loc: 18
Cost: 0 Rent: 0 Timer: 0 Level: 115
In room: 0 In object: (none) Carried by: Zeno
Index Values : 12 8 10 3 0 0.
Object Values: 12 8 80 3 0 0.
Attached shards: 0
int get_obj_weight( OBJ_DATA *obj )
{
int weight;
if ( !obj )
{
bug( "get_obj_weight: NULL obj!\n\r" );
return 0;
}
weight = obj->count * obj->weight;
/* magic containers */
if ( obj->item_type != ITEM_CONTAINER || !IS_OBJ_STAT(obj, ITEM_MAGIC) )
for ( obj = obj->first_content; obj; obj = obj->next_content )
weight += get_obj_weight(obj);
return weight;
}
Called from wear_obj:
OBJ_DATA *mw, *dw, *hd;
tmpobj = get_eq_char(ch, WEAR_WIELD);
mw = get_eq_char(ch, WEAR_MISSILE_WIELD);
dw = get_eq_char(ch, WEAR_DUAL_WIELD);
hd = get_eq_char(ch, WEAR_HOLD);
if ( tmpobj || mw )
{
if ( !can_dual( ch ) )
return;
if ( get_obj_weight(obj) + get_obj_weight(tmpobj) > (get_curr_str(ch)) )
{
send_to_char( "It is too heavy for you to wield.\n\r", ch );
return;
}
Okay, so I need to do some sort of check here for getting the weight of the worn eq.
This appears to be a bug, and I'm using SmaugFUSS. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|