context to g.context

This commit is contained in:
Bart House
2018-12-25 07:29:38 -08:00
parent 9069615861
commit 1c65e6afe0
70 changed files with 837 additions and 844 deletions

View File

@@ -142,6 +142,4 @@ struct context_info {
struct novel_tracking novel;
};
extern NEARDATA struct context_info context;
#endif /* CONTEXT_H */

View File

@@ -698,6 +698,7 @@ struct instance_globals {
#endif /* MICRO || WIN32 */
struct monst youmonst;
struct obj *invent;
struct context_info context;
/* dig.c */

View File

@@ -48,7 +48,7 @@
#define mon_warning(mon) \
(Warning && !(mon)->mpeaceful && (distu((mon)->mx, (mon)->my) < 100) \
&& (((int) ((mon)->m_lev / 4)) >= context.warnlevel))
&& (((int) ((mon)->m_lev / 4)) >= g.context.warnlevel))
/*
* mon_visible()

View File

@@ -246,12 +246,12 @@ struct sortloot_item {
typedef struct sortloot_item Loot;
#define MATCH_WARN_OF_MON(mon) \
(Warn_of_mon && ((context.warntype.obj \
&& (context.warntype.obj & (mon)->data->mflags2)) \
|| (context.warntype.polyd \
&& (context.warntype.polyd & (mon)->data->mflags2)) \
|| (context.warntype.species \
&& (context.warntype.species == (mon)->data))))
(Warn_of_mon && ((g.context.warntype.obj \
&& (g.context.warntype.obj & (mon)->data->mflags2)) \
|| (g.context.warntype.polyd \
&& (g.context.warntype.polyd & (mon)->data->mflags2)) \
|| (g.context.warntype.species \
&& (g.context.warntype.species == (mon)->data))))
#include "trap.h"
#include "flag.h"

View File

@@ -161,7 +161,7 @@ struct monst {
#define MON_NOWEP(mon) ((mon)->mw = (struct obj *) 0)
#define DEADMONSTER(mon) ((mon)->mhp < 1)
#define is_starting_pet(mon) ((mon)->m_id == context.startingpet_mid)
#define is_starting_pet(mon) ((mon)->m_id == g.context.startingpet_mid)
#define is_vampshifter(mon) \
((mon)->cham == PM_VAMPIRE || (mon)->cham == PM_VAMPIRE_LORD \
|| (mon)->cham == PM_VLAD_THE_IMPALER)