Don't discover generic objects

Potion of object detection and then looking at a generic object glyph
on the map would try to "discover" the generic object, and the loop
in discover_object would go too far, overwriting the exclusion_zones
pointer.

Take the easy route and just prevent discovery of generic objects;
there are probably other places where the generic objects should
be handled too, but the fuzzer hasn't hit them.
This commit is contained in:
Pasi Kallinen
2026-01-16 21:17:15 +02:00
parent 8b6ba69fd8
commit ae452e04b9

View File

@@ -451,6 +451,9 @@ discover_object(
boolean mark_as_encountered,
boolean credit_hero)
{
if (oindx < FIRST_OBJECT) /* don't discover generic objects */
return;
if ((!objects[oindx].oc_name_known && mark_as_known)
|| (!objects[oindx].oc_encountered && mark_as_encountered)
|| (Role_if(PM_SAMURAI)