checkItem(ch, WEAR_WIELD, xp );
checkItem(ch, WEAR_SECONDARY, xp );
void checkItem(CHAR_DATA *ch, int slot, int xp) {
OBJ_DATA *obj = get_eq_char(ch, slot);
if (!obj || !IS_OBJ_STAT (obj, ITEM_RELIC))
return;
//insert whatever you want to do with your object here
}
wield = get_eq_char( ch, WEAR_WIELD ); wield2 = get_eq_char(ch, WEAR_SECONDARY);
if (wield != NULL && wield2 != NULL) //if I change && to || it crashes the mud.
{
livingweap_needed = (wield->weapon_level * 750);
lwn2 = wield2->weapon_level * 750;
…
Original thought was to test to see if one weapon or the other weapon was present; no particular reason.
Then after I got the code to quit crashing (see commented part), I thought, what if the main weapon
gets disarmed during combat, I still want the second one to gain exp. I thought I added enough checks for
the secondary weapon not being NULL, but either I've overlooked a spot, or I just can't do what I want.
Any thoughts?