subs: Clean up direction code range checks
Compare with DIR_LAST instead of DIR_VIEW, to avoid assuming DIR_VIEW is the first non-direction code. While there, oops on unexpected code. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
2294785412
commit
bbacc28606
2 changed files with 4 additions and 2 deletions
|
@ -1021,7 +1021,8 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor)
|
||||||
if (CANT_HAPPEN(QEMPTY(list)))
|
if (CANT_HAPPEN(QEMPTY(list)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (dir <= DIR_STOP || dir >= DIR_VIEW) {
|
if (dir <= DIR_STOP || dir > DIR_LAST) {
|
||||||
|
CANT_HAPPEN(dir != DIR_STOP);
|
||||||
lnd_mar_put(list, actor);
|
lnd_mar_put(list, actor);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -796,7 +796,8 @@ shp_nav_one_sector(struct emp_qelem *list, int dir, natid actor)
|
||||||
if (CANT_HAPPEN(QEMPTY(list)))
|
if (CANT_HAPPEN(QEMPTY(list)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (dir <= DIR_STOP || dir >= DIR_VIEW) {
|
if (dir <= DIR_STOP || dir > DIR_LAST) {
|
||||||
|
CANT_HAPPEN(dir != DIR_STOP);
|
||||||
shp_nav_put(list, actor);
|
shp_nav_put(list, actor);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue