(pr_ship, doship, pr_land, dounit): Remove keys deprecated in
rev. 1.20. (prsect, doland): Deprecate key 'C'. (pr_plane, doplane): Deprecate keys 'a' and 'd'. (pr_land, dounit): Deprecate key 'X'. (pr_ship, doship): Deprecate keys 'H', 'P', 'X' and 'Y'. (docountry, dounit): Remove parameter farg.
This commit is contained in:
parent
67408f444e
commit
4e85ca6b30
1 changed files with 15 additions and 33 deletions
|
@ -60,11 +60,11 @@
|
||||||
#define END -1
|
#define END -1
|
||||||
|
|
||||||
static void benefit(natid, int);
|
static void benefit(natid, int);
|
||||||
static int docountry(char, int, char *, float, struct natstr *);
|
static int docountry(char, int, char *, struct natstr *);
|
||||||
static int doland(char, int, char *, struct sctstr *);
|
static int doland(char, int, char *, struct sctstr *);
|
||||||
static int doplane(char, int, char *, struct plnstr *);
|
static int doplane(char, int, char *, struct plnstr *);
|
||||||
static int doship(char, int, char *, struct shpstr *);
|
static int doship(char, int, char *, struct shpstr *);
|
||||||
static int dounit(char, int, char *, float, struct lndstr *);
|
static int dounit(char, int, char *, struct lndstr *);
|
||||||
static int getin(char *, char **);
|
static int getin(char *, char **);
|
||||||
static void noise(struct sctstr *, char *, int, int);
|
static void noise(struct sctstr *, char *, int, int);
|
||||||
static void pr_land(struct lndstr *);
|
static void pr_land(struct lndstr *);
|
||||||
|
@ -89,7 +89,6 @@ edit(void)
|
||||||
int err;
|
int err;
|
||||||
int arg_index = 3;
|
int arg_index = 3;
|
||||||
coord x, y;
|
coord x, y;
|
||||||
float farg;
|
|
||||||
struct natstr *np;
|
struct natstr *np;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char ewhat;
|
char ewhat;
|
||||||
|
@ -199,8 +198,7 @@ edit(void)
|
||||||
|
|
||||||
switch (ewhat) {
|
switch (ewhat) {
|
||||||
case 'c':
|
case 'c':
|
||||||
farg = (float)atof(ptr);
|
if ((err = docountry(thing, arg, ptr, np)) != RET_OK)
|
||||||
if ((err = docountry(thing, arg, ptr, farg, np)) != RET_OK)
|
|
||||||
return err;
|
return err;
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
|
@ -218,8 +216,7 @@ edit(void)
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
farg = (float)atof(ptr);
|
if ((err = dounit(thing, arg, ptr, &land)) != RET_OK)
|
||||||
if ((err = dounit(thing, arg, ptr, farg, &land)) != RET_OK)
|
|
||||||
return err;
|
return err;
|
||||||
if (!ef_ensure_space(EF_LAND, land.lnd_uid, 50))
|
if (!ef_ensure_space(EF_LAND, land.lnd_uid, 50))
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
@ -285,7 +282,6 @@ prsect(struct sctstr *sect)
|
||||||
sect->sct_fallout, sect->sct_avail);
|
sect->sct_fallout, sect->sct_avail);
|
||||||
|
|
||||||
pr("Mines <M>: %d\t", sect->sct_mines);
|
pr("Mines <M>: %d\t", sect->sct_mines);
|
||||||
pr("Coastal <C>: %d\n", sect->sct_coastal);
|
|
||||||
pr("Road %% <R>: %d\t", sect->sct_road);
|
pr("Road %% <R>: %d\t", sect->sct_road);
|
||||||
pr("Rail %% <r>: %d\t", sect->sct_rail);
|
pr("Rail %% <r>: %d\t", sect->sct_rail);
|
||||||
pr("Defense %% <d>: %d\n", sect->sct_defense);
|
pr("Defense %% <d>: %d\n", sect->sct_defense);
|
||||||
|
@ -337,8 +333,6 @@ pr_plane(struct plnstr *plane)
|
||||||
pr("Mobility <m>: %d\n", plane->pln_mobil);
|
pr("Mobility <m>: %d\n", plane->pln_mobil);
|
||||||
pr("Tech <t>: %d\t\t", plane->pln_tech);
|
pr("Tech <t>: %d\t\t", plane->pln_tech);
|
||||||
pr("Wing <w>: %c\n", plane->pln_wing);
|
pr("Wing <w>: %c\n", plane->pln_wing);
|
||||||
pr("Attack <a>: %d\t\t", plane->pln_att);
|
|
||||||
pr("Defense <d>: %d\n", plane->pln_def);
|
|
||||||
pr("Range <r>: %d\t\t", plane->pln_range);
|
pr("Range <r>: %d\t\t", plane->pln_range);
|
||||||
pr("Flags <f>: %d\n", plane->pln_flags);
|
pr("Flags <f>: %d\n", plane->pln_flags);
|
||||||
pr("Ship <s>: %d\t\t", plane->pln_ship);
|
pr("Ship <s>: %d\t\t", plane->pln_ship);
|
||||||
|
@ -359,7 +353,6 @@ pr_land(struct lndstr *land)
|
||||||
pr("Fortification <F>: %d\t", land->lnd_harden);
|
pr("Fortification <F>: %d\t", land->lnd_harden);
|
||||||
pr("Fuel <B>: %d\n", land->lnd_fuel);
|
pr("Fuel <B>: %d\n", land->lnd_fuel);
|
||||||
count_land_planes(land);
|
count_land_planes(land);
|
||||||
pr("Xlight planes <X>: %d\n", land->lnd_nxlight);
|
|
||||||
pr("Land unit <Y>: %d\n", land->lnd_land);
|
pr("Land unit <Y>: %d\n", land->lnd_land);
|
||||||
pr("Ship <S>: %d\t\t", land->lnd_ship);
|
pr("Ship <S>: %d\t\t", land->lnd_ship);
|
||||||
pr("Radius <P>: %d\n", land->lnd_rad_max);
|
pr("Radius <P>: %d\n", land->lnd_rad_max);
|
||||||
|
@ -400,11 +393,7 @@ pr_ship(struct shpstr *ship)
|
||||||
pr("Mobility <M>: %d\t\t", ship->shp_mobil);
|
pr("Mobility <M>: %d\t\t", ship->shp_mobil);
|
||||||
pr("Fleet <F>: %c\n", ship->shp_fleet);
|
pr("Fleet <F>: %c\n", ship->shp_fleet);
|
||||||
count_planes(ship);
|
count_planes(ship);
|
||||||
pr("Xlight planes <X>: %d\t\t", ship->shp_nxlight);
|
|
||||||
pr("Planes <P>: %d\n", ship->shp_nplane);
|
|
||||||
pr("Helos <H>: %d\t\t\t", ship->shp_nchoppers);
|
|
||||||
count_units(ship);
|
count_units(ship);
|
||||||
pr("Units <Y>: %d\n", ship->shp_nland);
|
|
||||||
/* could depend on opt_FUEL - but a deity might want to set this
|
/* could depend on opt_FUEL - but a deity might want to set this
|
||||||
up before enabling the option */
|
up before enabling the option */
|
||||||
pr("Fuel <B>: %d\t\t\t", ship->shp_fuel);
|
pr("Fuel <B>: %d\t\t\t", ship->shp_fuel);
|
||||||
|
@ -478,6 +467,7 @@ doland(char op, int arg, char *p, struct sctstr *sect)
|
||||||
int des;
|
int des;
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 'C':
|
case 'C':
|
||||||
|
warn_deprecated(op);
|
||||||
if (arg < 0)
|
if (arg < 0)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
sect->sct_coastal = (arg ? 1 : 0);
|
sect->sct_coastal = (arg ? 1 : 0);
|
||||||
|
@ -682,10 +672,11 @@ doland(char op, int arg, char *p, struct sctstr *sect)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
docountry(char op, int arg, char *p, float farg, struct natstr *np)
|
docountry(char op, int arg, char *p, struct natstr *np)
|
||||||
{
|
{
|
||||||
coord newx, newy;
|
coord newx, newy;
|
||||||
natid nat = np->nat_cnum;
|
natid nat = np->nat_cnum;
|
||||||
|
float farg = (float)atof(p);
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 'n':
|
case 'n':
|
||||||
|
@ -800,9 +791,11 @@ doship(char op, int arg, char *p, struct shpstr *ship)
|
||||||
ship->shp_rflags = arg;
|
ship->shp_rflags = arg;
|
||||||
break;
|
break;
|
||||||
case 'H':
|
case 'H':
|
||||||
|
warn_deprecated(op);
|
||||||
ship->shp_nchoppers = arg;
|
ship->shp_nchoppers = arg;
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
|
warn_deprecated(op);
|
||||||
ship->shp_nxlight = arg;
|
ship->shp_nxlight = arg;
|
||||||
break;
|
break;
|
||||||
case 'U':
|
case 'U':
|
||||||
|
@ -858,9 +851,11 @@ doship(char op, int arg, char *p, struct shpstr *ship)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Y':
|
case 'Y':
|
||||||
|
warn_deprecated(op);
|
||||||
ship->shp_nland = errcheck(arg, 0, 100);
|
ship->shp_nland = errcheck(arg, 0, 100);
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
|
warn_deprecated(op);
|
||||||
ship->shp_nplane = errcheck(arg, 0, 100);
|
ship->shp_nplane = errcheck(arg, 0, 100);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
|
@ -902,10 +897,6 @@ doship(char op, int arg, char *p, struct shpstr *ship)
|
||||||
case 'r':
|
case 'r':
|
||||||
ship->shp_item[I_RAD] = arg;
|
ship->shp_item[I_RAD] = arg;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
|
||||||
warn_deprecated(op);
|
|
||||||
ship->shp_armor = errcheck(arg, 0, SHRT_MAX);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
pr("huh? (%c)\n", op);
|
pr("huh? (%c)\n", op);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
@ -914,7 +905,7 @@ doship(char op, int arg, char *p, struct shpstr *ship)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dounit(char op, int arg, char *p, float farg, struct lndstr *land)
|
dounit(char op, int arg, char *p, struct lndstr *land)
|
||||||
{
|
{
|
||||||
coord newx, newy;
|
coord newx, newy;
|
||||||
|
|
||||||
|
@ -980,6 +971,7 @@ dounit(char op, int arg, char *p, float farg, struct lndstr *land)
|
||||||
land->lnd_fuel = errcheck(arg, 0, 255);
|
land->lnd_fuel = errcheck(arg, 0, 255);
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
|
warn_deprecated(op);
|
||||||
land->lnd_nxlight = arg;
|
land->lnd_nxlight = arg;
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
|
@ -1036,18 +1028,6 @@ dounit(char op, int arg, char *p, float farg, struct lndstr *land)
|
||||||
case 'r':
|
case 'r':
|
||||||
land->lnd_item[I_RAD] = arg;
|
land->lnd_item[I_RAD] = arg;
|
||||||
break;
|
break;
|
||||||
case 'A':
|
|
||||||
warn_deprecated(op);
|
|
||||||
pr("Attack changed from %1.2f to %1.2f.\n",
|
|
||||||
land->lnd_att, farg);
|
|
||||||
land->lnd_att = farg;
|
|
||||||
break;
|
|
||||||
case 'D':
|
|
||||||
warn_deprecated(op);
|
|
||||||
pr("Defense changed from %1.2f to %1.2f.\n",
|
|
||||||
land->lnd_def, farg);
|
|
||||||
land->lnd_def = farg;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
pr("huh? (%c)\n", op);
|
pr("huh? (%c)\n", op);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
@ -1116,9 +1096,11 @@ doplane(char op, int arg, char *p, struct plnstr *plane)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a':
|
||||||
|
warn_deprecated(op);
|
||||||
plane->pln_att = arg;
|
plane->pln_att = arg;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
|
warn_deprecated(op);
|
||||||
plane->pln_def = arg;
|
plane->pln_def = arg;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue