--- deliantra/server/common/button.C 2006/12/20 09:14:21 1.17 +++ deliantra/server/common/button.C 2006/12/21 01:33:49 1.18 @@ -869,31 +869,25 @@ * state in the inventory checker. This won't happen anymore now. * */ - void check_inv (object *op, object *trig) { - object *match = 0; - trig->value = 0; // deactivate if none of the following conditions apply - for (object *tmp = trig->above; tmp; tmp = tmp->above) - if (tmp->type == PLAYER) - { - object *match = check_inv_recursive (tmp, trig); + if (object *pl = trig->ms ().player ()) + { + object *match = check_inv_recursive (pl, trig); + + if (match && trig->last_sp) // match == having + { + if (trig->last_heal) + decrease_ob (match); - if (match && trig->last_sp) // match == having - { - if (trig->last_heal) - decrease_ob (match); - - trig->value = 1; - } - else if (!match && !trig->last_sp) // match == not having trig->value = 1; - - break; - } + } + else if (!match && !trig->last_sp) // match == not having + trig->value = 1; + } push_button (trig); }