avoidance, doc fixes. No functional changes.
short lnd_uid; /* unit id (land unit) */
coord lnd_x; /* x location in abs coords */
coord lnd_y; /* y location in abs coords */
- s_char lnd_type; /* ship type */
+ s_char lnd_type; /* index in lchr[] */
s_char lnd_effic; /* 0% to 100% */
s_char lnd_mobil; /* mobility units made int for RS/6000 */
short lnd_sell; /* pointer to trade file */
#define RESOLVE_IPADDRESS /* resolve ip addresses into hostnames */
#endif
-typedef u_char natid; /* also change NSC_NATID in nsc.h */
+typedef u_char natid; /* NSC_NATID must match this */
#if defined(__linux__ ) || defined(__osf__)
#define POSIXSIGNALS 1
#else
typedef signed char s_char;
#endif /* !aix && !sgi */
-typedef short coord; /* also change NSC_COORD in nsc.h */
+typedef short coord;
/*
* watch it; your compiler might not like this.
* If you think this is bogus, look at /usr/include/struct.h
#define NSC_SHORT (3<<18) /* pointer to short */
#define NSC_USHORT (4<<18) /* pointer to unsigned short */
#define NSC_INT (5<<18) /* pointer to int */
-#define NSC_LONG (6<<18) /* pointer to long */
+#define NSC_LONG (6<<18) /* pointer to long */
#define NSC_XCOORD (7<<18) /* pointer to coord that needs x conversion */
#define NSC_YCOORD (8<<18) /* pointer to coord that needs y conversion */
#define NSC_FLOAT (9<<18) /* pointer to float */
long ca_code; /* encoded form */
s_char *ca_name; /* name used for matches */
u_short ca_len; /* Used for arrays */
- long ca_edv; /* which commands is this field visible to? */
};
/* variables using the above */
extern struct castr loan_ca[];
extern struct castr genitem_ca[];
extern struct castr map_ca[];
-extern struct castr bmp_ca[];
extern struct castr lost_ca[];
extern struct castr commodity_ca[];
short pln_uid; /* plane unit id */
coord pln_x; /* plane x-y */
coord pln_y;
- s_char pln_type; /* fighter, bomber, etc */
+ s_char pln_type; /* index in plchr[] */
s_char pln_effic; /* actually "training" */
s_char pln_mobil; /* plane mobility */
short pln_sell; /* index into trade file */
short shp_uid; /* unit id (ship #) */
coord shp_x; /* x location in abs coords */
coord shp_y; /* y location in abs coords */
- s_char shp_type; /* ship type */
+ s_char shp_type; /* index in mchr[] */
s_char shp_effic; /* 0% to 100% */
s_char shp_mobil; /* mobility units */
short shp_sell; /* pointer to trade file */
}
}
-extern void
+void
resnoise(struct sctstr *sptr, int public_amt, s_char *name, int old,
int new)
{
logerror("tele: typed_wu failed to #%d", to);
} else if (*player->argp[0] == 'p') {
if (getele("your Gracious Deity", buf) <= 0) {
- pr("Prayor aborted\n");
+ pr("Prayer aborted\n");
return RET_OK;
}
pr("\n");
case 'L':
return lupgr();
default:
- pr("Ships, land units or planes only!\n");
- return RET_SYN;
+ break;
}
- return RET_OK;
+ pr("Ships, land units or planes only!\n");
+ return RET_SYN;
}
static int
lhs = decode(player->cnum, nsc->fld1, ptr, type);
op = oper;
- if ((op == '<' && lhs >= rhs) ||
- (op == '=' && lhs != rhs) ||
- (op == '>' && lhs <= rhs) || (op == '#' && lhs == rhs))
+ if ((op == '<' && lhs >= rhs)
+ || (op == '=' && lhs != rhs)
+ || (op == '>' && lhs <= rhs)
+ || (op == '#' && lhs == rhs))
return 0;
}
return 1;
* 2 = update only bmap with force
*/
-static int
- do_map_set(natid cnum, s_char *map, coord x, coord y, s_char t, int force, int sync);
+static int do_map_set(natid cnum, s_char *map, coord x, coord y,
+ s_char t, int force, int sync);
int
map_set(natid cnum, coord x, coord y, s_char t, int only_bmap)
return 0;
}
if (isdigit(*str) || ((*str == '-') && isdigit(str[1]))) {
-#ifdef BIT16ONLY
- /* XXX silently truncate to 16 bit int */
- *val = atoi(str) & 0xffff;
-#else
*val = atoi(str);
-#endif /* BIT16ONLY */
return 2;
}
+ /*
+ * FIXME This accepts the first match found, even if there are
+ * more matches in other tables, i.e. it quietly accepts ambiguous
+ * matches (matches in multiple tables), and fails to prefer an
+ * exact match to partial match in an earlier table.
+ */
if ((i = typematch(str, type)) >= 0) {
*val = i;
return 1;
if (i >= 0) {
*val = var_ca[i].ca_code & ~NSC_ROUND;
return legal_val(str, *val);
- return 1;
}
if (i == M_NOTUNIQUE) {
pr("%s -- ambiguous commodity selector\n", str);