Bug: Lever position ifcheck doesn't work properly
Danger: Low - State of functional levers, pullchains, switches, and buttons can't be checked
Found by: Remcon
Fixed by: Remcon
---
mud_prog.c, mprog_do_ifcheck
Locate:
if( !str_cmp( chck, "leverpos" ) )
{
int isup = FALSE, wantsup = FALSE;
if( chkobj->item_type != ITEM_SWITCH || chkobj->item_type != ITEM_LEVER || chkobj->item_type != ITEM_PULLCHAIN )
return FALSE;
if( IS_SET( obj->value[0], TRIG_UP ) )
isup = TRUE;
if( !str_cmp( rval, "up" ) )
wantsup = TRUE;
return mprog_veval( wantsup, opr, isup, mob );
}
Change to:
if( !str_cmp( chck, "leverpos" ) )
{
int isup = FALSE, wantsup = FALSE;
if( chkobj->item_type != ITEM_SWITCH && chkobj->item_type != ITEM_LEVER && chkobj->item_type != ITEM_PULLCHAIN && chkobj->item_type != ITEM_BUTTON )
return FALSE;
if( IS_SET( obj->value[0], TRIG_UP ) )
isup = TRUE;
if( !str_cmp( rval, "up" ) )
wantsup = TRUE;
return mprog_veval( wantsup, opr, isup, mob );
}
This ifcheck should only let 4 items times get passed it, so it needs to do an AND comparison. Not an OR comparison. Otherwise the check is somewhat useless.