(diridx): New. Use instead of chkdir() where direction characters
must be valid. Oopses on bad direction characters. (pathtoxy, ac_encounter): Bad direction characters used to lead to bad array subscript and potential disaster. (pathrange, path): Stop on DIR_STOP as well as on bad direction characters. This is just for consistency with other code; DIR_STOP should occur only last in a path here. (sail_nav_fleet, nav_ship): No change except for the oops.
This commit is contained in:
parent
a88f12017e
commit
dfa56cb0ef
6 changed files with 31 additions and 18 deletions
|
@ -63,6 +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 diridx(char);
|
||||
extern void direrr(s_char *, s_char *, s_char *);
|
||||
extern void pathrange(register coord, register coord, register s_char *,
|
||||
int, struct range *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue