]> git.pond.sub.org Git - empserver/commitdiff
Drop add's obscure sector check and wipe functionality
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 30 Oct 2011 14:51:46 +0000 (15:51 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 29 Dec 2011 10:47:05 +0000 (11:47 +0100)
If you really need to wipe out a country, there's much more to wipe
than just sectors.

info/add.t
src/lib/commands/add.c
src/lib/player/empmod.c
src/util/fairland.c

index b036af35a4c81beafe43b564310ee2fcf55d9752..111b5c2ee69310eaf398f00056ca11bc8a17f60d 100644 (file)
@@ -1,16 +1,14 @@
 .TH Command ADD
 .NA add "Add/Remove a country in the game"
 .LV Expert
-.SY "add <NAT> <NAME> <REP> <visitor|new|active|god|delete> <check|wipe|ignore>"
-.EX add 1 bunky mypass n i
+.SY "add <NAT> <NAME> <REP> <visitor|new|active|god|delete>"
+.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.
index e9ce528fe27c5994204dd37b232f009b8793a242..8a1aaba1abbec1f49aff96b22e01425de0848283 100644 (file)
 
 #include <config.h>
 
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
 #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, &sect)) {
-           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(&sect);
-               pr("wiped\n");
-           } else {
-               pr("\n");
-           }
-       }
-    }
-
     if (stat == STAT_NEW || stat == STAT_VIS)
        nat_reset(natp, stat, 0, 0);
     else {
index 794e861659fbdc71816da45562895e261925996c..058419c9839080036a8d7022402ad89c518bf157 100644 (file)
@@ -44,7 +44,7 @@
 struct cmndstr player_coms[] = {
 /*  command form                       cost    addr    permit */
     {"accept  [as-COUNTRY]", 0, acce, C_MOD, NORM},
-    {"add <NAT> <NAME> <REP> <STATUS> <c|w|i>", 0, add, C_MOD, GOD},
+    {"add <NAT> <NAME> <REP> <STATUS>", 0, add, C_MOD, GOD},
     {"announce", 0, tele, C_MOD, VIS},
     {"anti <SECT>", 3, anti, C_MOD, NORM + MONEY + CAP},
     {"apropos <topic>", 0, apro, 0, VIS},
index 069796e7039fa235a0fc1b418a2832fc2c6d7ec6..87e14e6ff8bb42e47c4fb53387c030e92bb66fbd 100644 (file)
@@ -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;
 }