Remove some redundant casts.
This commit is contained in:
parent
e2fe05be18
commit
ce6c039519
7 changed files with 16 additions and 16 deletions
|
@ -188,7 +188,7 @@ dd(natid att, natid def_own, coord ax, coord ay, int noisy, int defending)
|
|||
continue;
|
||||
if (firing.sct_own == 0)
|
||||
continue;
|
||||
if (firing.sct_effic < (u_char)FORTEFF)
|
||||
if (firing.sct_effic < FORTEFF)
|
||||
continue;
|
||||
rel = getrel(getnatp(firing.sct_own), def_own);
|
||||
rel2 = getrel(getnatp(firing.sct_own), att);
|
||||
|
@ -231,7 +231,7 @@ sb(natid att, natid def, struct sctstr *sp, coord tx, coord ty, int noisy,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (sp->sct_effic < (u_char)FORTEFF)
|
||||
if (sp->sct_effic < FORTEFF)
|
||||
return 0;
|
||||
|
||||
own = sp->sct_own;
|
||||
|
|
|
@ -549,7 +549,7 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
|
|||
a sub. */
|
||||
if (*s != 's')
|
||||
continue;
|
||||
if (sp->shp_mobil < (s_char)0)
|
||||
if (sp->shp_mobil < 0)
|
||||
continue;
|
||||
gun = sp->shp_item[I_GUN];
|
||||
if (gun < 1)
|
||||
|
|
|
@ -123,7 +123,7 @@ msl_hit(struct plnstr *pp, int hardtarget, int type, int news_item,
|
|||
|
||||
mpr(pp->pln_own, "\tSHWOOOOOSH! Missile launched!\n");
|
||||
|
||||
if (pp->pln_nuketype != (s_char)-1)
|
||||
if (pp->pln_nuketype != -1)
|
||||
mpr(pp->pln_own, "\tArming nuclear warheads...\n");
|
||||
|
||||
if (pcp->pl_flags & P_T)
|
||||
|
@ -144,7 +144,7 @@ msl_hit(struct plnstr *pp, int hardtarget, int type, int news_item,
|
|||
}
|
||||
}
|
||||
|
||||
if (pp->pln_nuketype != (s_char)-1)
|
||||
if (pp->pln_nuketype != -1)
|
||||
hitchance = 100;
|
||||
|
||||
mpr(pp->pln_own, "\t%d%% hitchance...", hitchance);
|
||||
|
@ -193,7 +193,7 @@ msl_sel(struct emp_qelem *list, coord x, coord y, natid victim,
|
|||
/* missiles go one way, so we can use all the range */
|
||||
if (plane.pln_range < mapdist(x, y, plane.pln_x, plane.pln_y))
|
||||
continue;
|
||||
if (plane.pln_mobil <= (s_char)0)
|
||||
if (plane.pln_mobil <= 0)
|
||||
continue;
|
||||
if (plane.pln_effic < 100)
|
||||
continue;
|
||||
|
|
|
@ -342,7 +342,7 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
|
|||
while (nxtitem(ni, (s_char *)&plane)) {
|
||||
if (!player->owner)
|
||||
continue;
|
||||
if (plane.pln_mobil <= (s_char)0)
|
||||
if (plane.pln_mobil <= 0)
|
||||
continue;
|
||||
if (opt_MARKET) {
|
||||
if (ontradingblock(EF_PLANE, (int *)&plane)) {
|
||||
|
@ -635,7 +635,7 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
|
|||
needed = pp->pln_load / ip->i_lbs;
|
||||
break;
|
||||
case 'n':
|
||||
if (pp->pln_nuketype == (s_char)-1)
|
||||
if (pp->pln_nuketype == -1)
|
||||
rval = -1;
|
||||
break;
|
||||
default:
|
||||
|
@ -1128,7 +1128,7 @@ pln_damage(struct plnstr *pp, coord x, coord y, s_char type, int *nukedamp,
|
|||
int effective = 1;
|
||||
int pinbomber = 0;
|
||||
|
||||
if (pp->pln_nuketype != (s_char)-1) {
|
||||
if (pp->pln_nuketype != -1) {
|
||||
mpr(pp->pln_own, "Releasing RV's for %s detonation...\n",
|
||||
pp->pln_flags & PLN_AIRBURST ? "airburst" : "groundburst");
|
||||
*nukedamp = detonate(pp, x, y);
|
||||
|
|
|
@ -144,7 +144,7 @@ radmap2(int owner,
|
|||
y = delty(&ns.range, (int)plane.pln_y);
|
||||
|
||||
if ((plane.pln_flags & PLN_LAUNCHED) && plane.pln_own != owner) {
|
||||
vis[y][x] = (s_char)100;
|
||||
vis[y][x] = 100;
|
||||
rad[y][x] = '$';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ takeover_plane(struct plnstr *pp, natid newown)
|
|||
if (n < 0)
|
||||
n = 0;
|
||||
pp->pln_effic = n;
|
||||
if (pp->pln_effic < PLANE_MINEFF || pp->pln_harden > (s_char)0) {
|
||||
if (pp->pln_effic < PLANE_MINEFF || pp->pln_harden > 0) {
|
||||
pp->pln_effic = 0;
|
||||
mpr(newown, "%s blown up by the crew!\n", prplane(pp));
|
||||
wu(0, pp->pln_own,
|
||||
|
@ -198,7 +198,7 @@ takeover_plane(struct plnstr *pp, natid newown)
|
|||
}
|
||||
if (opt_MARKET)
|
||||
trdswitchown(EF_PLANE, (int *)pp, newown);
|
||||
if (pp->pln_mobil > (s_char)0)
|
||||
if (pp->pln_mobil > 0)
|
||||
pp->pln_mobil = 0;
|
||||
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
|
||||
pp->pln_own = newown;
|
||||
|
|
|
@ -145,7 +145,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
|
|||
plane.pln_tech,
|
||||
plane.pln_effic,
|
||||
plchr[(int)plane.pln_type].pl_name, plane.pln_uid);
|
||||
if (plane.pln_nuketype != (s_char)-1) {
|
||||
if (plane.pln_nuketype != -1) {
|
||||
pr("(%s)", nchr[(int)plane.pln_nuketype].n_name);
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
|
|||
plane.pln_effic,
|
||||
plchr[(int)plane.pln_type].pl_name,
|
||||
plane.pln_uid);
|
||||
if (plane.pln_nuketype != (s_char)-1) {
|
||||
if (plane.pln_nuketype != -1) {
|
||||
pr("(%s)",
|
||||
nchr[(int)plane.pln_nuketype].
|
||||
n_name);
|
||||
|
@ -203,7 +203,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
|
|||
plane.pln_tech,
|
||||
plane.pln_effic,
|
||||
plchr[(int)plane.pln_type].pl_name, plane.pln_uid);
|
||||
if (plane.pln_nuketype != (s_char)-1) {
|
||||
if (plane.pln_nuketype != -1) {
|
||||
pr("(%s)", nchr[(int)plane.pln_nuketype].n_name);
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
|
|||
pp->pln_tech,
|
||||
pp->pln_effic,
|
||||
plchr[(int)pp->pln_type].pl_name, tp->trd_unitid);
|
||||
if (pp->pln_nuketype != (s_char)-1) {
|
||||
if (pp->pln_nuketype != -1) {
|
||||
pr("(%s)", nchr[(int)pp->pln_nuketype].n_name);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue