… | |
… | |
832 | * |
832 | * |
833 | */ |
833 | */ |
834 | void |
834 | void |
835 | check_inv (object *op, object *trig) |
835 | check_inv (object *op, object *trig) |
836 | { |
836 | { |
|
|
837 | sint32 prev_state = trig->value; |
837 | trig->value = 0; // deactivate if none of the following conditions apply |
838 | trig->value = 0; // deactivate if none of the following conditions apply |
838 | |
839 | |
839 | if (object *pl = trig->ms ().player ()) |
840 | if (object *pl = trig->ms ().player ()) |
840 | { |
841 | { |
841 | object *match = check_inv_recursive (pl, trig); |
842 | object *match = check_inv_recursive (pl, trig); |
… | |
… | |
849 | } |
850 | } |
850 | else if (!match && !trig->last_sp) // match == not having |
851 | else if (!match && !trig->last_sp) // match == not having |
851 | trig->value = 1; |
852 | trig->value = 1; |
852 | } |
853 | } |
853 | |
854 | |
|
|
855 | if (prev_state != trig->value) |
854 | push_button (trig); |
856 | push_button (trig); |
855 | } |
857 | } |
856 | |
858 | |