From: nethack.allison Date: Sat, 12 Jan 2002 02:16:09 +0000 (+0000) Subject: Since the touchstone uses objclass oc_color we need X-Git-Tag: MOVE2GIT~3501 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f64c0ac241cd5b4d4c98c92f9a86e6ce1ec44987;p=nethack Since the touchstone uses objclass oc_color we need to make that field unconditional, otherwise NetHack won't compile without TEXTCOLOR defined. Also provides at least an interim solution for the has_color() problem that Warwick pointed out. Lastly, Archeologists know touchstones. --- diff --git a/include/objclass.h b/include/objclass.h index 6dae474de..38dfb5850 100644 --- a/include/objclass.h +++ b/include/objclass.h @@ -91,9 +91,8 @@ struct objclass { uchar oc_oprop; /* property (invis, &c.) conveyed */ char oc_class; /* object class */ schar oc_delay; /* delay when using such an object */ -#ifdef TEXTCOLOR - uchar oc_color; /* display color of the object */ -#endif /* TEXTCOLOR */ + uchar oc_color; /* color of the object */ + short oc_prob; /* probability, used in mkobj() */ unsigned short oc_weight; /* encumbrance (1 cn = 0.1 lb.) */ short oc_cost; /* base cost in shops */ diff --git a/include/patchlevel.h b/include/patchlevel.h index 80d5178b7..97fea65cb 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -13,7 +13,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 1 +#define EDITLEVEL 2 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2002" diff --git a/src/mapglyph.c b/src/mapglyph.c index 91ad008c1..226f920f2 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -6,6 +6,7 @@ #if defined(TTY_GRAPHICS) #include "wintty.h" /* for prototype of has_color() only */ #endif +#include "color.h" int explcolors[] = { CLR_BLACK, /* dark */ @@ -17,6 +18,10 @@ int explcolors[] = { CLR_WHITE, /* frosty */ }; +#if !defined(TTY_GRAPHICS) +#define has_color(n) TRUE +#endif + #ifdef TEXTCOLOR #define zap_color(n) color = iflags.use_color ? zapcolors[n] : NO_COLOR #define cmap_color(n) color = iflags.use_color ? defsyms[n].color : NO_COLOR diff --git a/src/o_init.c b/src/o_init.c index 4c5a0c499..e15e66e45 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -75,9 +75,7 @@ shuffle(o_low, o_high, domaterial) { int i, j, num_to_shuffle; short sw; -#ifdef TEXTCOLOR int color; -#endif /* TEXTCOLOR */ for (num_to_shuffle = 0, j=o_low; j <= o_high; j++) if (!objects[j].oc_name_known) num_to_shuffle++; @@ -94,11 +92,10 @@ shuffle(o_low, o_high, domaterial) sw = objects[j].oc_tough; objects[j].oc_tough = objects[i].oc_tough; objects[i].oc_tough = sw; -#ifdef TEXTCOLOR color = objects[j].oc_color; objects[j].oc_color = objects[i].oc_color; objects[i].oc_color = color; -#endif /* TEXTCOLOR */ + /* shuffle material */ if (domaterial) { sw = objects[j].oc_material; diff --git a/src/objects.c b/src/objects.c index b13994981..03eb95489 100644 --- a/src/objects.c +++ b/src/objects.c @@ -13,12 +13,8 @@ struct monst { struct monst *dummy; }; /* lint: struct obj's union */ #else /* !OBJECTS_PASS_2_ */ /* second pass */ -# ifdef TEXTCOLOR #include "color.h" # define COLOR_FIELD(X) X, -# else -# define COLOR_FIELD(X) /*empty*/ -# endif #endif /* !OBJECTS_PASS_2_ */ diff --git a/src/u_init.c b/src/u_init.c index b4b61066d..6d2a93314 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -608,6 +608,7 @@ u_init() else if(!rn2(4)) ini_inv(Lamp); else if(!rn2(10)) ini_inv(Magicmarker); knows_object(SACK); + knows_object(TOUCHSTONE); skill_init(Skill_A); break; case PM_BARBARIAN: