From 62f0da239f3a41c291adb7e25ab8aa9e7aa54001 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 30 Oct 2011 15:51:46 +0100 Subject: [PATCH] Drop add's obscure sector check and wipe functionality If you really need to wipe out a country, there's much more to wipe than just sectors. --- info/add.t | 14 +++++------- src/lib/commands/add.c | 50 ----------------------------------------- src/lib/player/empmod.c | 2 +- src/util/fairland.c | 4 ++-- 4 files changed, 9 insertions(+), 61 deletions(-) diff --git a/info/add.t b/info/add.t index b036af35a..111b5c2ee 100644 --- a/info/add.t +++ b/info/add.t @@ -1,16 +1,14 @@ .TH Command ADD .NA add "Add/Remove a country in the game" .LV Expert -.SY "add " -.EX add 1 bunky mypass n i +.SY "add " +.EX add 1 bunky mypass n This adds a new player to the game. -.EX add 2 visitor visitor v i +.EX add 2 visitor visitor v This adds a visitor country to the game. -.EX add 1 bunky mypass d w -This removes bunky and all his sectors & units from the game. -.EX add 1 bunky mypass d c -Just to make sure that bunky doesn't still have any stuff in the game. -.EX add 36 martian outerspace a i +.EX add 1 bunky mypass d +This removes bunky from the game. +.EX add 36 martian outerspace a This will add a new country which will be able to send/receive telegrams but won't have any land. For example, you could give a newbie helper a country like this. diff --git a/src/lib/commands/add.c b/src/lib/commands/add.c index e9ce528fe..8a1aaba1a 100644 --- a/src/lib/commands/add.c +++ b/src/lib/commands/add.c @@ -33,20 +33,12 @@ #include -#include -#include -#include - #include "commands.h" -#include "optlist.h" -#include "plague.h" int add(void) { struct natstr *natp; - struct sctstr sect; - struct nstr_sect nstr; int i; char cntryname[sizeof(natp->nat_cnam)]; char pname[sizeof(natp->nat_pnam)]; @@ -117,50 +109,8 @@ add(void) pr("Illegal status\n"); return RET_SYN; } - p = getstarg(player->argp[5], - "Check, wipe, or ignore existing sectors (c|w|i) ", buf); - if (!p) - return RET_SYN; strcpy(natp->nat_cnam, cntryname); strcpy(natp->nat_pnam, pname); - if (*p != 'w' && *p != 'c') { - pr("Any existing sectors ignored\n"); - } else { - pr("Checking sectors...\n"); - snxtsct_all(&nstr); - while (nxtsct(&nstr, §)) { - if (sect.sct_own != coun) - continue; - pr("%s ", xyas(nstr.x, nstr.y, player->cnum)); - if (*p == 'w') { - sect.sct_mobil = 0; - sect.sct_effic = 0; - sect.sct_road = 0; - sect.sct_rail = 0; - sect.sct_defense = 0; - sect.sct_own = 0; - sect.sct_oldown = 0; - sect.sct_newtype = sect.sct_type - = dchr[sect.sct_type].d_terrain; - sect.sct_dist_x = sect.sct_x; - sect.sct_dist_y = sect.sct_y; - memset(sect.sct_item, 0, sizeof(sect.sct_item)); - memset(sect.sct_del, 0, sizeof(sect.sct_del)); - memset(sect.sct_dist, 0, sizeof(sect.sct_dist)); - sect.sct_mines = 0; - sect.sct_pstage = PLG_HEALTHY; - sect.sct_ptime = 0; - sect.sct_che = 0; - sect.sct_che_target = 0; - sect.sct_fallout = 0; - putsect(§); - pr("wiped\n"); - } else { - pr("\n"); - } - } - } - if (stat == STAT_NEW || stat == STAT_VIS) nat_reset(natp, stat, 0, 0); else { diff --git a/src/lib/player/empmod.c b/src/lib/player/empmod.c index 794e86165..058419c98 100644 --- a/src/lib/player/empmod.c +++ b/src/lib/player/empmod.c @@ -44,7 +44,7 @@ struct cmndstr player_coms[] = { /* command form cost addr permit */ {"accept [as-COUNTRY]", 0, acce, C_MOD, NORM}, - {"add ", 0, add, C_MOD, GOD}, + {"add ", 0, add, C_MOD, GOD}, {"announce", 0, tele, C_MOD, VIS}, {"anti ", 3, anti, C_MOD, NORM + MONEY + CAP}, {"apropos ", 0, apro, 0, VIS}, diff --git a/src/util/fairland.c b/src/util/fairland.c index 069796e70..87e14e6ff 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -1153,12 +1153,12 @@ write_newcap_script(void) } for (c = 0; c < nc; ++c) { - fprintf(script, "add %d %d %d n i\n", c + 1, c + 1, c + 1); + fprintf(script, "add %d %d %d n\n", c + 1, c + 1, c + 1); if (AIRPORT_MARKER) fprintf(script, "des %d,%d -\n", capx[c], capy[c]); fprintf(script, "newcap %d %d,%d\n", c + 1, capx[c], capy[c]); } - fprintf(script, "add %d visitor visitor v i\n", c + 1); + fprintf(script, "add %d visitor visitor v\n", c + 1); fclose(script); return 0; } -- 2.43.0