… | |
… | |
1726 | * inv must have been an container and must have been active. |
1726 | * inv must have been an container and must have been active. |
1727 | * |
1727 | * |
1728 | * Change the color so that the message doesn't disappear with |
1728 | * Change the color so that the message doesn't disappear with |
1729 | * all the others. |
1729 | * all the others. |
1730 | */ |
1730 | */ |
1731 | if (pl->contr->usekeys == key_inventory || |
1731 | if (pl->contr->usekeys == key_inventory |
1732 | !QUERY_FLAG (container, FLAG_APPLIED) || |
1732 | || !QUERY_FLAG (container, FLAG_APPLIED) |
1733 | (pl->contr->usekeys == keyrings && container->race != shstr_keys)) |
1733 | || (pl->contr->usekeys == keyrings && container->race != shstr_keys)) |
1734 | { |
1734 | { |
1735 | new_draw_info_format (NDI_UNIQUE | NDI_BROWN, 0, pl, |
1735 | new_draw_info_format (NDI_UNIQUE | NDI_BROWN, 0, pl, |
1736 | "The %s in your %s vibrates as you approach the door", query_name (tmp), query_name (container)); |
1736 | "The %s in your %s vibrates as you approach the door", query_name (tmp), query_name (container)); |
1737 | return NULL; |
1737 | return NULL; |
1738 | } |
1738 | } |
… | |
… | |
1751 | { |
1751 | { |
1752 | /* If its a door, try to find a key. If we do destroy the door, |
1752 | /* If its a door, try to find a key. If we do destroy the door, |
1753 | * might as well return immediately as there is nothing more to do - |
1753 | * might as well return immediately as there is nothing more to do - |
1754 | * otherwise, we fall through to the rest of the code. |
1754 | * otherwise, we fall through to the rest of the code. |
1755 | */ |
1755 | */ |
|
|
1756 | object *key; |
|
|
1757 | |
|
|
1758 | if (door->slaying && is_match_expr (door->slaying)) |
|
|
1759 | { |
|
|
1760 | // for match expressions, we try to find the key by applying the match |
|
|
1761 | // to the op itself, which is supposed to find the "key", instead |
|
|
1762 | // of searching through containers ourselves. |
|
|
1763 | |
|
|
1764 | key = match_one (door->slaying, op, door, op, op); |
|
|
1765 | } |
|
|
1766 | else |
1756 | object *key = find_key (op, op, door); |
1767 | key = find_key (op, op, door); |
1757 | |
1768 | |
1758 | /* If we found a key, do some extra work */ |
1769 | /* If we found a key, do some extra work */ |
1759 | if (key) |
1770 | if (key) |
1760 | { |
1771 | { |
1761 | object *container = key->env; |
1772 | object *container = key->env; |