static int
edit_sect(struct sctstr *sect, char op, int arg, char *p)
{
- natid newown, oldown;
coord newx, newy;
int new, old;
int des;
switch (op) {
case 'o':
- if (arg < 0)
+ if (arg < 0 || arg >= MAXNOC)
return RET_SYN;
- newown = (natid)LIMIT_TO(arg, 0, MAXNOC - 1);
pr("Owner of %s changed from %s to %s.\n",
xyas(sect->sct_x, sect->sct_y, player->cnum),
- prnatid(sect->sct_own), prnatid(newown));
+ prnatid(sect->sct_own), prnatid(arg));
if (sect->sct_own) {
wu(player->cnum, sect->sct_own,
"Sector %s lost to deity intervention\n",
xyas(sect->sct_x, sect->sct_y, sect->sct_own));
}
benefit(sect->sct_own, 0);
- sect->sct_own = newown;
- if (newown) {
- wu(player->cnum, newown,
+ sect->sct_own = arg;
+ if (arg) {
+ wu(player->cnum, arg,
"Sector %s gained from deity intervention\n",
- xyas(sect->sct_x, sect->sct_y, newown));
+ xyas(sect->sct_x, sect->sct_y, arg));
}
- benefit(newown, 1);
+ benefit(arg, 1);
break;
case 'O':
- if (arg < 0)
+ if (arg < 0 || arg >= MAXNOC)
return RET_SYN;
- oldown = (natid)LIMIT_TO(arg, 0, MAXNOC - 1);
pr("Old owner of %s changed from %s to %s.\n",
xyas(sect->sct_x, sect->sct_y, player->cnum),
- prnatid(sect->sct_oldown), prnatid(oldown));
- sect->sct_oldown = oldown;
+ prnatid(sect->sct_oldown), prnatid(arg));
+ sect->sct_oldown = arg;
break;
case 'e':
new = LIMIT_TO(arg, 0, 100);
sect->sct_che = new;
break;
case 'X':
- old = sect->sct_che_target;
- new = LIMIT_TO(arg, 0, MAXNOC - 1);
+ if (arg < 0 || arg >= MAXNOC)
+ return RET_SYN;
pr("Che target of %s changed from %s to %s.\n",
xyas(sect->sct_x, sect->sct_y, player->cnum),
- prnatid(old), prnatid(new));
- sect->sct_che_target = new;
- if (new == 0)
+ prnatid(sect->sct_che_target), prnatid(arg));
+ sect->sct_che_target = arg;
+ if (arg == 0)
sect->sct_che = 0;
break;
case 'p':
ef_set_uid(EF_SHIP, ship, arg);
break;
case 'O':
+ if (arg < 0 || arg >= MAXNOC)
+ return RET_SYN;
if (ship->shp_own)
wu(player->cnum, ship->shp_own,
"%s taken from you by deity intervention!\n", prship(ship));
- if (arg && arg < MAXNOC) {
+ if (arg) {
wu(player->cnum, (natid)arg,
"%s given to you by deity intervention!\n", prship(ship));
ship->shp_own = (natid)arg;
- } else if (!arg)
+ } else
ship->shp_effic = 0;
break;
case 'L':
ef_set_uid(EF_LAND, land, arg);
break;
case 'O':
+ if (arg < 0 || arg >= MAXNOC)
+ return RET_SYN;
if (land->lnd_own)
wu(player->cnum, land->lnd_own,
"%s taken from you by deity intervention!\n", prland(land));
-
- if (arg && arg < MAXNOC) {
+ if (arg) {
wu(player->cnum, (natid)arg,
"%s given to you by deity intervention!\n", prland(land));
land->lnd_own = (natid)arg;
- } else if (!arg)
+ } else
land->lnd_effic = 0;
break;
case 'L':
plane->pln_y = newy;
break;
case 'O':
+ if (arg < 0 || arg >= MAXNOC)
+ return RET_SYN;
if (plane->pln_own)
wu(player->cnum, plane->pln_own,
"%s taken from you by deity intervention!\n",
prplane(plane));
- if (arg && arg < MAXNOC) {
+ if (arg) {
plane->pln_own = (natid)arg;
wu(player->cnum, plane->pln_own,
"%s given to you by deity intervention!\n", prplane(plane));
- } else if (!arg)
+ } else
plane->pln_effic = 0;
break;
case 'e':
Play#0 output Play#0 6 0 640
Play#0 input edit l 3,7 o 99
Play#0 command edit
- Play#0 output Play#0 1 Owner of 3,7 changed from 98 (#98) to 98 (#98).
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit l 1,7 O 0
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit l 3,7 O 99
Play#0 command edit
- Play#0 output Play#0 1 Old owner of 3,7 changed from 98 (#98) to 98 (#98).
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit l 1,7 X 0
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit l 1,7 X -1
Play#0 command edit
- Play#0 output Play#0 1 Che target of 1,7 changed from POGO (#0) to POGO (#0).
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit l 3,7 X 98
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit l 3,7 X 99
Play#0 command edit
- Play#0 output Play#0 1 Che target of 3,7 changed from 98 (#98) to 98 (#98).
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit l 5,7 o 2
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit s 0 O -1
Play#0 command edit
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit s 1 O 98
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit s 1 O 99
Play#0 command edit
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit s 2 O 2
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit p 0 O -1
Play#0 command edit
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit p 1 O 98
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit p 1 O 99
Play#0 command edit
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit p 2 O 2
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit u 0 O -1
Play#0 command edit
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit u 1 O 98
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit u 1 O 99
Play#0 command edit
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit u 2 O 2
Play#0 command edit
Play#0 output Play#0 1
Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970
Play#0 output Play#0 1 Sector 3,7 gained from deity intervention
- Play#0 output Play#0 1 Sector 3,7 lost to deity intervention
- Play#0 output Play#0 1 Sector 3,7 gained from deity intervention
Play#0 output Play#0 1 Sector 9,7 gained from deity intervention
Play#0 output Play#0 1 cs cargo ship (#1) given to you by deity intervention!
- Play#0 output Play#0 1 cs cargo ship (#1) taken from you by deity intervention!
Play#0 output Play#0 1 f1 Sopwith Camel #1 given to you by deity intervention!
- Play#0 output Play#0 1 f1 Sopwith Camel #1 taken from you by deity intervention!
Play#0 output Play#0 1 sup supply #1 given to you by deity intervention!
- Play#0 output Play#0 1 sup supply #1 taken from you by deity intervention!
Play#0 output Play#0 6 0 640
Play#0 input ctld
Play#0 output Play#0 1 Bye-bye