Revert "objnam.c globals moved to instance globals."

This reverts commit 041e55467a.
This commit is contained in:
nhmall
2018-11-23 22:16:35 -05:00
parent 3cbc6d4cf5
commit 734a6c2ddb
3 changed files with 8 additions and 13 deletions

View File

@@ -461,13 +461,6 @@ struct instance_globals {
/* muse.c */ /* muse.c */
boolean m_using; /* kludge to use mondided instead of killed */ boolean m_using; /* kludge to use mondided instead of killed */
/* objname.c */
/* distantname used by distant_name() to pass extra information to
xname_flags(); it would be much cleaner if this were a parameter,
but that would require all of the xname() and doname() calls to be
modified */
int distantname;
/* pickup.c */ /* pickup.c */
int oldcap; /* last encumberance */ int oldcap; /* last encumberance */
/* current_container is set in use_container(), to be used by the /* current_container is set in use_container(), to be used by the

View File

@@ -345,9 +345,6 @@ const struct instance_globals g_init = {
/* mused.c */ /* mused.c */
FALSE, /* m_using */ FALSE, /* m_using */
/* objname.c */
0, /* distantname */
/* pickup.c */ /* pickup.c */
0, /* oldcap */ 0, /* oldcap */
UNDEFINED_PTR, /* current_container */ UNDEFINED_PTR, /* current_container */

View File

@@ -210,6 +210,11 @@ struct obj *obj;
return TRUE; return TRUE;
} }
/* used by distant_name() to pass extra information to xname_flags();
it would be much cleaner if this were a parameter, but that would
require all of the xname() and doname() calls to be modified */
static int distantname = 0;
/* Give the name of an object seen at a distance. Unlike xname/doname, /* Give the name of an object seen at a distance. Unlike xname/doname,
* we don't want to set dknown if it's not set already. * we don't want to set dknown if it's not set already.
*/ */
@@ -228,9 +233,9 @@ char *FDECL((*func), (OBJ_P));
* object is within X-ray radius and only treat it as distant when * object is within X-ray radius and only treat it as distant when
* beyond that radius. Logic is iffy but result might be interesting. * beyond that radius. Logic is iffy but result might be interesting.
*/ */
++g.distantname; ++distantname;
str = (*func)(obj); str = (*func)(obj);
--g.distantname; --distantname;
return str; return str;
} }
@@ -420,7 +425,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
*/ */
if (!nn && ocl->oc_uses_known && ocl->oc_unique) if (!nn && ocl->oc_uses_known && ocl->oc_unique)
obj->known = 0; obj->known = 0;
if (!Blind && !g.distantname) if (!Blind && !distantname)
obj->dknown = TRUE; obj->dknown = TRUE;
if (Role_if(PM_PRIEST)) if (Role_if(PM_PRIEST))
obj->bknown = TRUE; obj->bknown = TRUE;