… | |
… | |
335 | * pl is invisible. |
335 | * pl is invisible. |
336 | */ |
336 | */ |
337 | int |
337 | int |
338 | makes_invisible_to (object *pl, object *mon) |
338 | makes_invisible_to (object *pl, object *mon) |
339 | { |
339 | { |
340 | |
|
|
341 | if (!pl->invisible) |
340 | if (!pl->invisible) |
342 | return 0; |
341 | return 0; |
|
|
342 | |
343 | if (pl->type == PLAYER) |
343 | if (pl->type == PLAYER) |
344 | { |
344 | { |
345 | /* If race isn't set, then invisible unless it is undead */ |
345 | /* If race isn't set, then invisible unless it is undead */ |
346 | if (!pl->contr->invis_race) |
346 | if (!pl->contr->invis_race) |
347 | { |
347 | { |
348 | if (QUERY_FLAG (mon, FLAG_UNDEAD)) |
348 | if (QUERY_FLAG (mon, FLAG_UNDEAD)) |
349 | return 0; |
349 | return 0; |
|
|
350 | |
350 | return 1; |
351 | return 1; |
351 | } |
352 | } |
|
|
353 | |
352 | /* invis_race is set if we get here */ |
354 | /* invis_race is set if we get here */ |
353 | if (!strcmp (pl->contr->invis_race, "undead") && is_true_undead (mon)) |
355 | if (!strcmp (pl->contr->invis_race, "undead") && is_true_undead (mon)) |
354 | return 1; |
356 | return 1; |
|
|
357 | |
355 | /* No race, can't be invisible to it */ |
358 | /* No race, can't be invisible to it */ |
356 | if (!mon->race) |
359 | if (!mon->race) |
357 | return 0; |
360 | return 0; |
|
|
361 | |
358 | if (strstr (mon->race, pl->contr->invis_race)) |
362 | if (strstr (mon->race, pl->contr->invis_race)) |
359 | return 1; |
363 | return 1; |
|
|
364 | |
360 | /* Nothing matched above, return 0 */ |
365 | /* Nothing matched above, return 0 */ |
361 | return 0; |
366 | return 0; |
362 | } |
367 | } |
363 | else |
368 | else |
364 | { |
369 | { |