From c41c45be618d4a0dd2287355802f86bd2caca3d0 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 23 Jul 2005 18:35:07 +0000 Subject: [PATCH] Delete some code that has been disabled out for ages and looks useless or wrong. --- src/lib/commands/buil.c | 26 -------------------------- src/lib/commands/load.c | 10 ---------- src/lib/subs/fortdef.c | 21 --------------------- src/lib/subs/retreat.c | 24 ------------------------ src/lib/update/sect.c | 14 -------------- 5 files changed, 95 deletions(-) diff --git a/src/lib/commands/buil.c b/src/lib/commands/buil.c index 7e40e4bf..bd729f64 100644 --- a/src/lib/commands/buil.c +++ b/src/lib/commands/buil.c @@ -602,32 +602,6 @@ build_bridge(struct sctstr *sp, short *vec) return 0; } } -#if 0 - else { - - for (i = 1; i <= 6; i++) { - struct sctstr s2; - nx = sp->sct_x + diroff[i][0]; - ny = sp->sct_y + diroff[i][1]; - getsect(nx, ny, §); - for (j = 1; j <= 6; j++) { - nx2 = sect.sct_x + diroff[j][0]; - ny2 = sect.sct_y + diroff[j][1]; - getsect(nx2, ny2, &s2); - if ((s2.sct_type != SCT_WATER) && - (s2.sct_type != SCT_BSPAN)) - good = 1; - } - - } - - if (!good) { - pr("Bridges must be built adjacent to land or bridge towers.\n"); - pr("No eligible sectors adjacent to this sector.\n"); - return 0; - } - } /* end EASY_BRIDGES */ -#endif if (sp->sct_effic < 60 && !player->god) { pr("Sector %s is not 60%% efficient.\n", diff --git a/src/lib/commands/load.c b/src/lib/commands/load.c index ead2aa64..4f7d71b3 100644 --- a/src/lib/commands/load.c +++ b/src/lib/commands/load.c @@ -628,16 +628,6 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy, } return 0; } -#if 0 - if (sp->shp_nland >= mchr[(int)sp->shp_type].m_nland) { - if (noisy) - if (mchr[(int)sp->shp_type].m_nland) - pr("%s doesn't have room for any more land units!\n", prship(sp)); - else - pr("%s cannot carry land units!\n", prship(sp)); - break; - } -#endif sprintf(buf, "loaded on your %s at %s", prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own)); gift(sp->shp_own, player->cnum, (s_char *)&land, EF_LAND, buf); diff --git a/src/lib/subs/fortdef.c b/src/lib/subs/fortdef.c index 0a99b691..562a3544 100644 --- a/src/lib/subs/fortdef.c +++ b/src/lib/subs/fortdef.c @@ -144,27 +144,6 @@ sd(natid att, natid own, coord x, coord y, int noisy, int defending, return (int)100 - (eff * 100); } -/* - * Determine if any nearby gun-equipped sectors are within - * range and able to fire at an attacker. Firing sectors - * need to have guns, shells, and military. Sector being - * attacked is x,y -- attacker is at ax,ay. - */ -#if 0 -/* defdef isn't called anywhere, and uses wrong - * number of arguments for dd */ -int -defdef(att, def_own, defval, ax, ay) -natid att; -natid def_own; -int defval; -coord ax; -coord ay; -{ - return dd(att, def_own, defval, ax, ay, NOISY, 1); -} -#endif - int dd(natid att, natid def_own, coord ax, coord ay, int noisy, int defending) { diff --git a/src/lib/subs/retreat.c b/src/lib/subs/retreat.c index 99b0cdd9..141860f7 100644 --- a/src/lib/subs/retreat.c +++ b/src/lib/subs/retreat.c @@ -339,30 +339,6 @@ retreat_ship1(struct shpstr *sp, s_char code, int orig) return 1; } -#if 0 -static int -check_nav(sect) -struct sctstr *sect; -{ - switch (dchr[sect->sct_type].d_flg & 03) { - case NAVOK: - break; - - case NAV_02: - if (sect->sct_effic < 2) - return CN_CONSTRUCTION; - break; - case NAV_60: - if (sect->sct_effic < 60) - return CN_CONSTRUCTION; - break; - default: - return CN_LANDLOCKED; - } - return CN_NAVIGABLE; -} -#endif - static int findcondition(s_char code) { diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index 4a98cf59..d4f16273 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -247,14 +247,6 @@ spread_fallout(struct sctstr *sp, int etus) if (ap->sct_type == SCT_SANCT) continue; inc = roundavg(etus * fallout_spread * (sp->sct_fallout)) - 1; -#if 0 - if (sp->sct_fallout) { - wu(0, 0, "Fallout from sector %d,%d to %d,%d is %d=%d*%e*%d\n", - sp->sct_x, sp->sct_y, sp->sct_x + diroff[n][0], - sp->sct_y + diroff[n][1], inc, etus, - fallout_spread, sp->sct_fallout); - } -#endif if (inc < 0) inc = 0; ap->sct_fallout = min(ap->sct_fallout + inc, FALLOUT_MAX); @@ -271,12 +263,6 @@ decay_fallout(struct sctstr *sp, int etus) decay = roundavg(((decay_per_etu + 6.0) * fallout_spread) * (double)etus * (double)sp->sct_fallout); -#if 0 - if (decay || sp->sct_fallout) - wu(0, 0, "Fallout decay in %d,%d is %d from %d\n", sp->sct_x, - sp->sct_y, decay, sp->sct_fallout); -#endif - sp->sct_fallout = decay < sp->sct_fallout ? sp->sct_fallout - decay : 0; }