From 3e1d9f25c8a992fb915d18ffaccb3a266e8ad0a4 Mon Sep 17 00:00:00 2001 From: billf Date: Tue, 7 Sep 1999 06:00:03 +0000 Subject: Avoid ambigious if() if() else(). --- games/sail/dr_1.c | 9 ++++++--- games/sail/pl_3.c | 12 ++++++++---- games/sail/pl_7.c | 6 ++++-- games/sail/sync.c | 9 ++++++--- 4 files changed, 24 insertions(+), 12 deletions(-) (limited to 'games/sail') diff --git a/games/sail/dr_1.c b/games/sail/dr_1.c index 52ab369..239be81 100644 --- a/games/sail/dr_1.c +++ b/games/sail/dr_1.c @@ -346,11 +346,12 @@ compcombat() hit++; hit += QUAL[index][capship(sp)->specs->qual - 1]; for (n = 0; n < 3 && sp->file->captured == 0; n++) - if (!crew[n]) + if (!crew[n]) { if (index <= 5) hit--; else hit -= 2; + } if (ready & R_INITIAL) { if (!r) sp->file->readyL &= ~R_INITIAL; @@ -361,11 +362,12 @@ compcombat() else hit += 2; } - if (sp->file->captured != 0) + if (sp->file->captured != 0) { if (index <= 1) hit--; else hit -= 2; + } hit += AMMO[index][load - 1]; temp = sp->specs->class; if ((temp >= 5 || temp == 1) && windspeed == 5) @@ -385,11 +387,12 @@ compcombat() next() { - if (++turn % 55 == 0) + if (++turn % 55 == 0) { if (alive) alive = 0; else people = 0; + } if (people <= 0 || windspeed == 7) { register struct ship *s; struct ship *bestship; diff --git a/games/sail/pl_3.c b/games/sail/pl_3.c index 3aee8b9..23ef384 100644 --- a/games/sail/pl_3.c +++ b/games/sail/pl_3.c @@ -124,11 +124,12 @@ acceptcombat() else if (temp > 8) temp -= 8; sternrake = temp > 4 && temp < 6; - if (rakehim) + if (rakehim) { if (!sternrake) Signal("Raking the %s!", closest); else Signal("Stern Rake! %s splintering!", closest); + } index = guns; if (target < 3) index += car; @@ -142,21 +143,24 @@ acceptcombat() hit++; hit += QUAL[index][mc->qual-1]; for (n = 0; n < 3 && mf->captured == 0; n++) - if (!crew[n]) + if (!crew[n]) { if (index <= 5) hit--; else hit -= 2; - if (ready & R_INITIAL) + } + if (ready & R_INITIAL) { if (index <= 3) hit++; else hit += 2; - if (mf->captured != 0) + } + if (mf->captured != 0) { if (index <= 1) hit--; else hit -= 2; + } hit += AMMO[index][load - 1]; if (((temp = mc->class) >= 5 || temp == 1) && windspeed == 5) hit--; diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index 80efdd0..e7afd95 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -84,16 +84,18 @@ newturn() movebuf[0] = '\0'; (void) alarm(0); - if (mf->readyL & R_LOADING) + if (mf->readyL & R_LOADING) { if (mf->readyL & R_DOUBLE) mf->readyL = R_LOADING; else mf->readyL = R_LOADED; - if (mf->readyR & R_LOADING) + } + if (mf->readyR & R_LOADING) { if (mf->readyR & R_DOUBLE) mf->readyR = R_LOADING; else mf->readyR = R_LOADED; + } if (!hasdriver) Write(W_DDEAD, SHIP(0), 0, 0, 0, 0, 0); diff --git a/games/sail/sync.c b/games/sail/sync.c index b896eed..ab663a9 100644 --- a/games/sail/sync.c +++ b/games/sail/sync.c @@ -264,7 +264,7 @@ sync_update(type, ship, a, b, c, d) } case W_UNFOUL: { register struct snag *p = &ship->file->foul[a]; - if (p->sn_count > 0) + if (p->sn_count > 0) { if (b) { ship->file->nfoul -= p->sn_count; p->sn_count = 0; @@ -272,11 +272,12 @@ sync_update(type, ship, a, b, c, d) ship->file->nfoul--; p->sn_count--; } + } break; } case W_UNGRAP: { register struct snag *p = &ship->file->grap[a]; - if (p->sn_count > 0) + if (p->sn_count > 0) { if (b) { ship->file->ngrap -= p->sn_count; p->sn_count = 0; @@ -284,14 +285,16 @@ sync_update(type, ship, a, b, c, d) ship->file->ngrap--; p->sn_count--; } + } break; } case W_SIGNAL: - if (mode == MODE_PLAYER) + if (mode == MODE_PLAYER) { if (nobells) Signal("%s (%c%c): %s", ship, a); else Signal("\7%s (%c%c): %s", ship, a); + } break; case W_CREW: { register struct shipspecs *s = ship->specs; -- cgit v1.1