fix github issue #427 - unreadable mail

The change to make mail objects and monsters separate from mail
delivery (so that toggling the latter wouldn't invalidate save
and bones files) made it possible to wish for scrolls of mail,
find such in bones left by someone who did, or write such via
magic marker.  That was probably unintentional but I've left it
as-is.  The problem was that reading such scrolls issued a
warning:  "What weird effect is this?" because reading scrolls
of mail was only allowed when interacting with MAIL was enabled.

The issue suggested replacing #if MAIL with #if MAIL_STRUCTURES
in seffects(), and then insert #if MAIL in the part of reading
that deals with 'real' (or randomly faked for micros) mail.  I've
done both of those, and also added a couple of message variations
for the unreal cases.

Closes #427
This commit is contained in:
PatR
2020-12-24 13:41:17 -08:00
parent a4184c8684
commit 5552f141ba
3 changed files with 43 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 invent.c $NHDT-Date: 1606765212 2020/11/30 19:40:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.308 $ */
/* NetHack 3.7 invent.c $NHDT-Date: 1608846067 2020/12/24 21:41:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.310 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3784,6 +3784,15 @@ register struct obj *otmp, *obj;
: (!has_omailcmd(otmp) || strcmp(OMAILCMD(obj), OMAILCMD(otmp)) != 0))
return FALSE;
#ifdef MAIL_STRUCTURES
if (obj->otyp == SCR_MAIL
/* wished or bones mail and hand written stamped scrolls
each have two flavors; spe keeps them separate from each
other but we want to keep their flavors separate too */
&& obj->spe > 0 && (obj->o_id % 2) != (otmp->o_id % 2))
return FALSE;
#endif
/* should be moot since matching artifacts wouldn't be unique */
if (obj->oartifact != otmp->oartifact)
return FALSE;