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.
This commit is contained in:
nethack.allison
2002-01-12 02:16:09 +00:00
parent 2e62cf4194
commit f64c0ac241
6 changed files with 10 additions and 12 deletions
+2 -3
View File
@@ -91,9 +91,8 @@ struct objclass {
uchar oc_oprop; /* property (invis, &c.) conveyed */ uchar oc_oprop; /* property (invis, &c.) conveyed */
char oc_class; /* object class */ char oc_class; /* object class */
schar oc_delay; /* delay when using such an object */ schar oc_delay; /* delay when using such an object */
#ifdef TEXTCOLOR uchar oc_color; /* color of the object */
uchar oc_color; /* display color of the object */
#endif /* TEXTCOLOR */
short oc_prob; /* probability, used in mkobj() */ short oc_prob; /* probability, used in mkobj() */
unsigned short oc_weight; /* encumbrance (1 cn = 0.1 lb.) */ unsigned short oc_weight; /* encumbrance (1 cn = 0.1 lb.) */
short oc_cost; /* base cost in shops */ short oc_cost; /* base cost in shops */
+1 -1
View File
@@ -13,7 +13,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones * Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files. * and save files.
*/ */
#define EDITLEVEL 1 #define EDITLEVEL 2
#define COPYRIGHT_BANNER_A \ #define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2002" "NetHack, Copyright 1985-2002"
+5
View File
@@ -6,6 +6,7 @@
#if defined(TTY_GRAPHICS) #if defined(TTY_GRAPHICS)
#include "wintty.h" /* for prototype of has_color() only */ #include "wintty.h" /* for prototype of has_color() only */
#endif #endif
#include "color.h"
int explcolors[] = { int explcolors[] = {
CLR_BLACK, /* dark */ CLR_BLACK, /* dark */
@@ -17,6 +18,10 @@ int explcolors[] = {
CLR_WHITE, /* frosty */ CLR_WHITE, /* frosty */
}; };
#if !defined(TTY_GRAPHICS)
#define has_color(n) TRUE
#endif
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
#define zap_color(n) color = iflags.use_color ? zapcolors[n] : NO_COLOR #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 #define cmap_color(n) color = iflags.use_color ? defsyms[n].color : NO_COLOR
+1 -4
View File
@@ -75,9 +75,7 @@ shuffle(o_low, o_high, domaterial)
{ {
int i, j, num_to_shuffle; int i, j, num_to_shuffle;
short sw; short sw;
#ifdef TEXTCOLOR
int color; int color;
#endif /* TEXTCOLOR */
for (num_to_shuffle = 0, j=o_low; j <= o_high; j++) for (num_to_shuffle = 0, j=o_low; j <= o_high; j++)
if (!objects[j].oc_name_known) num_to_shuffle++; if (!objects[j].oc_name_known) num_to_shuffle++;
@@ -94,11 +92,10 @@ shuffle(o_low, o_high, domaterial)
sw = objects[j].oc_tough; sw = objects[j].oc_tough;
objects[j].oc_tough = objects[i].oc_tough; objects[j].oc_tough = objects[i].oc_tough;
objects[i].oc_tough = sw; objects[i].oc_tough = sw;
#ifdef TEXTCOLOR
color = objects[j].oc_color; color = objects[j].oc_color;
objects[j].oc_color = objects[i].oc_color; objects[j].oc_color = objects[i].oc_color;
objects[i].oc_color = color; objects[i].oc_color = color;
#endif /* TEXTCOLOR */
/* shuffle material */ /* shuffle material */
if (domaterial) { if (domaterial) {
sw = objects[j].oc_material; sw = objects[j].oc_material;
-4
View File
@@ -13,12 +13,8 @@ struct monst { struct monst *dummy; }; /* lint: struct obj's union */
#else /* !OBJECTS_PASS_2_ */ #else /* !OBJECTS_PASS_2_ */
/* second pass */ /* second pass */
# ifdef TEXTCOLOR
#include "color.h" #include "color.h"
# define COLOR_FIELD(X) X, # define COLOR_FIELD(X) X,
# else
# define COLOR_FIELD(X) /*empty*/
# endif
#endif /* !OBJECTS_PASS_2_ */ #endif /* !OBJECTS_PASS_2_ */
+1
View File
@@ -608,6 +608,7 @@ u_init()
else if(!rn2(4)) ini_inv(Lamp); else if(!rn2(4)) ini_inv(Lamp);
else if(!rn2(10)) ini_inv(Magicmarker); else if(!rn2(10)) ini_inv(Magicmarker);
knows_object(SACK); knows_object(SACK);
knows_object(TOUCHSTONE);
skill_init(Skill_A); skill_init(Skill_A);
break; break;
case PM_BARBARIAN: case PM_BARBARIAN: