(check_nav, shp_check_nav, sail_nav_fleet, retreat_ship1):
Make shp_check_nav() public. Remove check_nav(), replace with shp_check_nav(). No functional change as check_nav() and shp_check_nav() are identical.
This commit is contained in:
parent
8ef5b87d90
commit
1d58f58e1b
5 changed files with 5 additions and 28 deletions
|
@ -684,6 +684,7 @@ extern int shp_sweep(struct emp_qelem *, int, natid);
|
||||||
extern s_char *shp_path(int, struct shpstr *, s_char *);
|
extern s_char *shp_path(int, struct shpstr *, s_char *);
|
||||||
extern void shp_put(struct emp_qelem *, natid);
|
extern void shp_put(struct emp_qelem *, natid);
|
||||||
extern void shp_list(struct emp_qelem *);
|
extern void shp_list(struct emp_qelem *);
|
||||||
|
extern int shp_check_nav(struct sctstr *);
|
||||||
extern int shp_hardtarget(struct shpstr *);
|
extern int shp_hardtarget(struct shpstr *);
|
||||||
extern void shp_view(struct emp_qelem *);
|
extern void shp_view(struct emp_qelem *);
|
||||||
extern int shp_nav_one_sector(struct emp_qelem *, int, natid, int);
|
extern int shp_nav_one_sector(struct emp_qelem *, int, natid, int);
|
||||||
|
@ -762,7 +763,6 @@ extern void prod_nat(int);
|
||||||
/* nav_ship.c */
|
/* nav_ship.c */
|
||||||
extern int nav_ship(register struct shpstr *);
|
extern int nav_ship(register struct shpstr *);
|
||||||
/* nav_util.c */
|
/* nav_util.c */
|
||||||
extern int check_nav(struct sctstr *);
|
|
||||||
extern int load_it(struct shpstr *, struct sctstr *,
|
extern int load_it(struct shpstr *, struct sctstr *,
|
||||||
int);
|
int);
|
||||||
extern void unload_it(struct shpstr *);
|
extern void unload_it(struct shpstr *);
|
||||||
|
|
|
@ -188,7 +188,7 @@ retreat_ship1(struct shpstr *sp, s_char code, int orig)
|
||||||
}
|
}
|
||||||
|
|
||||||
getsect(sp->shp_x, sp->shp_y, §);
|
getsect(sp->shp_x, sp->shp_y, §);
|
||||||
switch (check_nav(§)) {
|
switch (shp_check_nav(§)) {
|
||||||
case CN_CONSTRUCTION:
|
case CN_CONSTRUCTION:
|
||||||
wu(0, sp->shp_own,
|
wu(0, sp->shp_own,
|
||||||
"%s %s,\nbut was caught in a construction zone, and couldn't retreat!\n",
|
"%s %s,\nbut was caught in a construction zone, and couldn't retreat!\n",
|
||||||
|
@ -262,7 +262,7 @@ retreat_ship1(struct shpstr *sp, s_char code, int orig)
|
||||||
mobcost = 480.0 / (mobcost + techfact(sp->shp_tech, mobcost));
|
mobcost = 480.0 / (mobcost + techfact(sp->shp_tech, mobcost));
|
||||||
|
|
||||||
getsect(newx, newy, §);
|
getsect(newx, newy, §);
|
||||||
if (check_nav(§) != CN_NAVIGABLE ||
|
if (shp_check_nav(§) != CN_NAVIGABLE ||
|
||||||
(sect.sct_own && !player->owner &&
|
(sect.sct_own && !player->owner &&
|
||||||
getrel(getnatp(sect.sct_own), sp->shp_own) < FRIENDLY)) {
|
getrel(getnatp(sect.sct_own), sp->shp_own) < FRIENDLY)) {
|
||||||
wu(0, sp->shp_own, "%s %s,\nbut could not retreat to %s!\n",
|
wu(0, sp->shp_own, "%s %s,\nbut could not retreat to %s!\n",
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
static int shp_check_nav(struct sctstr *);
|
|
||||||
static int shp_check_one_mines(struct mlist *);
|
static int shp_check_one_mines(struct mlist *);
|
||||||
static int shp_hit_mine(struct shpstr *, struct mchrstr *);
|
static int shp_hit_mine(struct shpstr *, struct mchrstr *);
|
||||||
static void shp_mess(s_char *, struct mlist *);
|
static void shp_mess(s_char *, struct mlist *);
|
||||||
|
@ -368,7 +367,7 @@ shp_mess(s_char *str, struct mlist *mlp)
|
||||||
free(mlp);
|
free(mlp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
shp_check_nav(struct sctstr *sect)
|
shp_check_nav(struct sctstr *sect)
|
||||||
{
|
{
|
||||||
switch (dchr[sect->sct_type].d_flg & 03) {
|
switch (dchr[sect->sct_type].d_flg & 03) {
|
||||||
|
|
|
@ -54,28 +54,6 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "gen.h"
|
#include "gen.h"
|
||||||
|
|
||||||
/* Format a ship name */
|
|
||||||
int
|
|
||||||
check_nav(struct sctstr *sect)
|
|
||||||
{
|
|
||||||
switch (dchr[sect->sct_type].d_flg & 03) {
|
|
||||||
case NAVOK:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NAV_02:
|
|
||||||
if (sect->sct_effic < 2)
|
|
||||||
return CN_CONSTRUCTION;
|
|
||||||
break;
|
|
||||||
case NAV_60:
|
|
||||||
if (sect->sct_effic < 60)
|
|
||||||
return CN_CONSTRUCTION;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return CN_LANDLOCKED;
|
|
||||||
}
|
|
||||||
return CN_NAVIGABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* load a specific ship given its
|
/* load a specific ship given its
|
||||||
* location and what field to modify.
|
* location and what field to modify.
|
||||||
* new autonav code
|
* new autonav code
|
||||||
|
|
|
@ -239,7 +239,7 @@ sail_nav_fleet(struct fltheadstr *fltp)
|
||||||
wu(0, fltp->own, "\n");
|
wu(0, fltp->own, "\n");
|
||||||
#endif
|
#endif
|
||||||
sectp = getsectp(fltp->x, fltp->y);
|
sectp = getsectp(fltp->x, fltp->y);
|
||||||
switch (check_nav(sectp)) {
|
switch (shp_check_nav(sectp)) {
|
||||||
case CN_NAVIGABLE:
|
case CN_NAVIGABLE:
|
||||||
break;
|
break;
|
||||||
case CN_CONSTRUCTION:
|
case CN_CONSTRUCTION:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue