pull request #927 - charging vs undiscovered tools

Pull request from entrez:  don't list undiscovered or unseen (picked
up while blind, still blind) tools as likely candidates for charging.
They're still eligible to be chosen for charging but using a scroll
to charge something else won't reveal not-yet-known tools as being
magic.

Fixes #927
This commit is contained in:
PatR
2022-11-19 00:43:16 -08:00

View File

@@ -698,7 +698,13 @@ charge_ok(struct obj* obj)
&& !objects[MAGIC_LAMP].oc_name_known)) {
return GETOBJ_SUGGEST;
}
return objects[obj->otyp].oc_charged ? GETOBJ_SUGGEST : GETOBJ_EXCLUDE;
/* suggest chargeable tools only if discovered, to prevent leaking
info (e.g. revealing if an unidentified 'flute' is magic or not) */
if (objects[obj->otyp].oc_charged) {
return (obj->dknown && objects[obj->otyp].oc_name_known)
? GETOBJ_SUGGEST : GETOBJ_DOWNPLAY;
}
return GETOBJ_EXCLUDE;
}
/* why are weapons/armor considered charged anyway?
* make them selectable even so for "feeling of loss" message */