(SELL_NOT_DELIV, getdir, chkpath): Unused, remove.
This commit is contained in:
parent
6304f3b482
commit
6bfdc38df1
2 changed files with 0 additions and 53 deletions
|
@ -51,8 +51,6 @@
|
|||
#define DIR_FIRST 1
|
||||
#define DIR_LAST 6
|
||||
|
||||
#define SELL_NOT_DELIV 7 /* in "_use" field => contract */
|
||||
|
||||
extern int dirindex[];
|
||||
extern int diroff[][2];
|
||||
extern s_char dirch[];
|
||||
|
@ -65,9 +63,7 @@ extern double ncost(struct sctstr *, natid);
|
|||
extern double pathtoxy(s_char *, coord *, coord *,
|
||||
double (*)(struct sctstr * sp, natid own));
|
||||
extern int chkdir(s_char, int, int);
|
||||
extern int getdir(s_char *, s_char *, s_char *, s_char *);
|
||||
extern void direrr(s_char *, s_char *, s_char *);
|
||||
extern int chkpath(natid, s_char *, coord, coord);
|
||||
extern void pathrange(register coord, register coord, register s_char *,
|
||||
int, struct range *);
|
||||
|
||||
|
|
|
@ -40,34 +40,6 @@
|
|||
#include "file.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
int
|
||||
getdir(s_char *prompt, s_char *stop_msg, s_char *view_msg,
|
||||
s_char *bomb_msg)
|
||||
{
|
||||
register int max_dir;
|
||||
register int min_dir;
|
||||
register int dir_num;
|
||||
s_char buf[1024];
|
||||
|
||||
if (stop_msg != 0)
|
||||
min_dir = DIR_STOP;
|
||||
else
|
||||
min_dir = DIR_FIRST;
|
||||
if (view_msg == 0)
|
||||
max_dir = DIR_LAST;
|
||||
else
|
||||
max_dir = DIR_VIEW;
|
||||
while (1) {
|
||||
if (getstring(prompt, buf) == 0 || *buf == 0)
|
||||
return -1;
|
||||
dir_num = chkdir(buf[0], min_dir, max_dir);
|
||||
if (dir_num >= min_dir)
|
||||
break;
|
||||
direrr(stop_msg, view_msg, bomb_msg);
|
||||
}
|
||||
return dir_num;
|
||||
}
|
||||
|
||||
int
|
||||
chkdir(s_char dir_char, int min_dir, int max_dir)
|
||||
{
|
||||
|
@ -263,27 +235,6 @@ pathtoxy(s_char *path, coord *xp, coord *yp,
|
|||
return m;
|
||||
}
|
||||
|
||||
/*
|
||||
* return true if "who" owns the path starting at x,y
|
||||
*/
|
||||
int
|
||||
chkpath(natid who, s_char *path, coord x, coord y)
|
||||
{
|
||||
s_char *pp;
|
||||
int val;
|
||||
struct sctstr sect;
|
||||
|
||||
for (pp = path; *pp; pp++) {
|
||||
if ((val = chkdir(*pp, DIR_STOP, DIR_LAST)) == 0)
|
||||
break;
|
||||
x += diroff[val][0];
|
||||
y += diroff[val][1];
|
||||
if (!getsect(x, y, §) || sect.sct_own != who)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
pathrange(register coord cx, register coord cy, register s_char *pp,
|
||||
int border, struct range *range)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue