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>
if (CANT_HAPPEN(QEMPTY(list)))
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);
return 1;
}
if (CANT_HAPPEN(QEMPTY(list)))
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);
return 1;
}