… | |
… | |
768 | |
768 | |
769 | tmp->set_owner (tmp2); |
769 | tmp->set_owner (tmp2); |
770 | SET_FLAG (tmp, FLAG_MONSTER); |
770 | SET_FLAG (tmp, FLAG_MONSTER); |
771 | |
771 | |
772 | tmp->stats.exp = 0; |
772 | tmp->stats.exp = 0; |
773 | SET_FLAG (tmp, FLAG_FRIENDLY); |
|
|
774 | |
773 | |
775 | add_friendly_object (tmp); |
774 | add_friendly_object (tmp); |
776 | tmp->attack_movement = PETMOVE; |
775 | tmp->attack_movement = PETMOVE; |
777 | break; |
776 | break; |
778 | |
777 | |
… | |
… | |
833 | * |
832 | * |
834 | */ |
833 | */ |
835 | void |
834 | void |
836 | check_inv (object *op, object *trig) |
835 | check_inv (object *op, object *trig) |
837 | { |
836 | { |
|
|
837 | sint32 prev_state = trig->value; |
838 | trig->value = 0; // deactivate if none of the following conditions apply |
838 | trig->value = 0; // deactivate if none of the following conditions apply |
839 | |
839 | |
840 | if (object *pl = trig->ms ().player ()) |
840 | if (object *pl = trig->ms ().player ()) |
841 | { |
841 | { |
842 | object *match = check_inv_recursive (pl, trig); |
842 | object *match = check_inv_recursive (pl, trig); |
… | |
… | |
850 | } |
850 | } |
851 | else if (!match && !trig->last_sp) // match == not having |
851 | else if (!match && !trig->last_sp) // match == not having |
852 | trig->value = 1; |
852 | trig->value = 1; |
853 | } |
853 | } |
854 | |
854 | |
|
|
855 | if (prev_state != trig->value) |
855 | push_button (trig); |
856 | push_button (trig); |
856 | } |
857 | } |
857 | |
858 | |