From 0218ca19ab4bdde192b6396b1c9582eaec11bf8c Mon Sep 17 00:00:00 2001 From: Eric Branlund Date: Mon, 11 Dec 2023 07:46:00 -0700 Subject: [PATCH] Object sensing: scan full pile for noticing; do not notice known ignored items See discussion here, https://forum.angband.live/forum/showthread.php?t=11614 . In object detection, also scan full pile for noticing. --- src/effect-handler-general.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/effect-handler-general.c b/src/effect-handler-general.c index c5ecde715..b2ec8720f 100644 --- a/src/effect-handler-general.c +++ b/src/effect-handler-general.c @@ -1685,8 +1685,19 @@ bool effect_handler_SENSE_OBJECTS(effect_handler_context_t *context) continue; } - /* Notice an object is detected */ - objects = true; + /* + * Is there any object which either has not been seen + * or has been seen and is not ignored? If so, notify + * the player. + */ + for (; !objects && obj; obj = obj->next) { + if (!obj->known + || obj->known->kind == unknown_gold_kind + || obj->known->kind == unknown_item_kind + || !ignore_item_ok(player, obj)) { + objects = true; + } + } /* Mark the pile as aware */ square_sense_pile(cave, grid); @@ -1739,9 +1750,14 @@ bool effect_handler_DETECT_OBJECTS(effect_handler_context_t *context) continue; } - /* Notice an object is detected */ - if (!ignore_item_ok(player, obj)) { - objects = true; + /* + * Is there any object which is not ignored? If so, + * notify the player. + */ + for (; !objects && obj; obj = obj->next) { + if (!ignore_item_ok(player, obj)) { + objects = true; + } } /* Mark the pile as seen */