(carg, lcarg, fort, land, ldump, lsta, orde, payo, retr, lretr)

(cmd_sail_ship, cmd_unsail_ship, show_sail, sdump, shi, sstat, work):
Remove inappropriate ship/land sanity checks; should be done
elsewhere.
This commit is contained in:
Markus Armbruster 2005-11-06 20:54:59 +00:00
parent a7aea6c468
commit 190cbaadf2
13 changed files with 0 additions and 69 deletions

View file

@ -56,10 +56,6 @@ carg(void)
continue; continue;
if ((player->cnum != ship.shp_own) && !player->god) if ((player->cnum != ship.shp_own) && !player->god)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
continue;
}
if (nships++ == 0) if (nships++ == 0)
pr("shp# ship type x,y flt eff sh gun pet irn dst bar oil lcm hcm rad\n"); pr("shp# ship type x,y flt eff sh gun pet irn dst bar oil lcm hcm rad\n");
pr("%4d ", ni.cur); pr("%4d ", ni.cur);
@ -106,10 +102,6 @@ lcarg(void)
continue; continue;
if ((player->cnum != land.lnd_own) && !player->god) if ((player->cnum != land.lnd_own) && !player->god)
continue; continue;
if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
continue;
}
if (nunits++ == 0) if (nunits++ == 0)
pr("lnd# unit type x,y a eff sh gun pet irn dst bar oil lcm hcm rad\n"); pr("lnd# unit type x,y a eff sh gun pet irn dst bar oil lcm hcm rad\n");
pr("%4d ", ni.cur); pr("%4d ", ni.cur);

View file

@ -62,11 +62,6 @@ fort(void)
while (nxtitem(&ni, &land)) { while (nxtitem(&ni, &land)) {
if (!player->owner || land.lnd_own == 0) if (!player->owner || land.lnd_own == 0)
continue; continue;
if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
continue;
}
getland(land.lnd_uid, &land); getland(land.lnd_uid, &land);
if (land.lnd_mobil < 0) if (land.lnd_mobil < 0)
continue; continue;

View file

@ -56,10 +56,6 @@ land(void)
continue; continue;
if (!player->owner && !player->god) if (!player->owner && !player->god)
continue; continue;
if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
continue;
}
count_land_planes(&land); count_land_planes(&land);
lnd_count_units(&land); lnd_count_units(&land);

View file

@ -294,10 +294,6 @@ ldump(void)
continue; continue;
if (!player->owner && !player->god) if (!player->owner && !player->god)
continue; continue;
if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
continue;
}
count_land_planes(&land); count_land_planes(&land);
lnd_count_units(&land); lnd_count_units(&land);

View file

@ -52,10 +52,6 @@ lsta(void)
while (nxtitem(&ni, &land)) { while (nxtitem(&ni, &land)) {
if (!player->owner || land.lnd_own == 0) if (!player->owner || land.lnd_own == 0)
continue; continue;
if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
continue;
}
count_land_planes(&land); count_land_planes(&land);
if (nunits++ == 0) { if (nunits++ == 0) {

View file

@ -86,10 +86,6 @@ orde(void)
while (!player->aborted && nxtitem(&nb, (&ship))) { while (!player->aborted && nxtitem(&nb, (&ship))) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, nb.cur);
continue;
}
if (opt_SAIL) { if (opt_SAIL) {
if (*ship.shp_path) { if (*ship.shp_path) {
if (!diffeachship) if (!diffeachship)

View file

@ -64,10 +64,6 @@ payo(void)
while (nxtitem(&ni, &ship)) { while (nxtitem(&ni, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
continue;
}
mp = &mchr[(int)ship.shp_type]; mp = &mchr[(int)ship.shp_type];
if (!(mp->m_flags & M_TRADE)) if (!(mp->m_flags & M_TRADE))

View file

@ -137,10 +137,6 @@ retr(void)
while (nxtitem(&ni, &ship)) { while (nxtitem(&ni, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
continue;
}
if (zero) if (zero)
memset(ship.shp_rpath, 0, sizeof(ship.shp_rpath)); memset(ship.shp_rpath, 0, sizeof(ship.shp_rpath));
@ -268,10 +264,6 @@ lretr(void)
while (nxtitem(&ni, &land)) { while (nxtitem(&ni, &land)) {
if (!player->owner || land.lnd_own == 0) if (!player->owner || land.lnd_own == 0)
continue; continue;
if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
continue;
}
if (zero) if (zero)
memset(land.lnd_rpath, 0, sizeof(land.lnd_rpath)); memset(land.lnd_rpath, 0, sizeof(land.lnd_rpath));

View file

@ -51,10 +51,6 @@ show_sail(struct nstr_item *nstr)
while (nxtitem(nstr, &ship)) { while (nxtitem(nstr, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, nstr->cur);
continue;
}
if (count++ == 0) { if (count++ == 0) {
if (player->god) if (player->god)
pr("own "); pr("own ");
@ -101,10 +97,6 @@ cmd_unsail_ship(struct nstr_item *nstr)
while (nxtitem(nstr, &ship)) { while (nxtitem(nstr, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, nstr->cur);
continue;
}
if (ship.shp_path[0]) { if (ship.shp_path[0]) {
pr("Ship #%d unsailed\n", ship.shp_uid); pr("Ship #%d unsailed\n", ship.shp_uid);
count++; count++;
@ -125,10 +117,6 @@ cmd_sail_ship(struct nstr_item *nstr)
while (!player->aborted && nxtitem(nstr, &ship)) { while (!player->aborted && nxtitem(nstr, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, nstr->cur);
continue;
}
if ((ship.shp_autonav & AN_AUTONAV) && if ((ship.shp_autonav & AN_AUTONAV) &&
!(ship.shp_autonav & AN_STANDBY)) { !(ship.shp_autonav & AN_STANDBY)) {
pr("Ship #%d has other orders!\n", ship.shp_uid); pr("Ship #%d has other orders!\n", ship.shp_uid);

View file

@ -267,10 +267,6 @@ sdump(void)
while (nxtitem(&ni, &ship)) { while (nxtitem(&ni, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
continue;
}
count_planes(&ship); count_planes(&ship);
count_units(&ship); count_units(&ship);
nships++; nships++;

View file

@ -55,10 +55,6 @@ shi(void)
while (nxtitem(&ni, &ship)) { while (nxtitem(&ni, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
continue;
}
count_planes(&ship); count_planes(&ship);
count_units(&ship); count_units(&ship);
if (nships++ == 0) { if (nships++ == 0) {

View file

@ -52,10 +52,6 @@ sstat(void)
while (nxtitem(&ni, &ship)) { while (nxtitem(&ni, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
continue;
}
count_planes(&ship); count_planes(&ship);
count_units(&ship); count_units(&ship);

View file

@ -70,10 +70,6 @@ work(void)
while (nxtitem(&ni, &land)) { while (nxtitem(&ni, &land)) {
if (!player->owner || land.lnd_own == 0) if (!player->owner || land.lnd_own == 0)
continue; continue;
if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
continue;
}
if (!(lchr[(int)land.lnd_type].l_flags & L_ENGINEER)) if (!(lchr[(int)land.lnd_type].l_flags & L_ENGINEER))
continue; continue;
if (land.lnd_mobil <= 0) { if (land.lnd_mobil <= 0) {