… | |
… | |
1880 | if (enemy->hide) |
1880 | if (enemy->hide) |
1881 | { |
1881 | { |
1882 | make_visible (enemy); |
1882 | make_visible (enemy); |
1883 | new_draw_info (NDI_UNIQUE, 0, enemy, "Your light reveals your hiding spot!"); |
1883 | new_draw_info (NDI_UNIQUE, 0, enemy, "Your light reveals your hiding spot!"); |
1884 | } |
1884 | } |
|
|
1885 | |
1885 | return 1; |
1886 | return 1; |
1886 | } |
1887 | } |
1887 | else if (enemy->hide) |
1888 | else if (enemy->hide) |
1888 | return 0; |
1889 | return 0; |
1889 | |
1890 | |
1890 | /* Invisible enemy. Break apart the check for invis undead/invis looker |
1891 | /* Invisible enemy. Break apart the check for invis undead/invis looker |
1891 | * into more simple checks - the QUERY_FLAG doesn't return 1/0 values, |
1892 | * into more simple checks - the QUERY_FLAG doesn't return 1/0 values, |
1892 | * and making it a conditional makes the code pretty ugly. |
1893 | * and making it a conditional makes the code pretty ugly. |
1893 | */ |
1894 | */ |
1894 | if (!QUERY_FLAG (looker, FLAG_SEE_INVISIBLE)) |
1895 | if (!QUERY_FLAG (looker, FLAG_SEE_INVISIBLE)) |
1895 | { |
|
|
1896 | if (makes_invisible_to (enemy, looker)) |
1896 | if (makes_invisible_to (enemy, looker)) |
1897 | return 0; |
1897 | return 0; |
1898 | } |
|
|
1899 | } |
1898 | } |
1900 | else if (looker->type == PLAYER) /* for players, a (possible) shortcut */ |
1899 | else if (looker->type == PLAYER) /* for players, a (possible) shortcut */ |
1901 | if (player_can_view (looker, enemy)) |
1900 | if (player_can_view (looker, enemy)) |
1902 | return 1; |
1901 | return 1; |
1903 | |
1902 | |