Restrict FootpathPlaceAction more correctly

direction_valid() restricts the direction to 0-3, not 0-15. As discussed on Gitter, this is more correct.
This commit is contained in:
Richard Fine committed 2019-09-01 18:40:21 +01:00
1 parent caa6ad71c7
commit bf3461e014
1 file changed
+1 -1
+1 -1
View File
@@ -88,7 +88,7 @@ public:
return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_HIGH);
}
if (_direction != 0xFF && _direction > 15)
if (_direction != INVALID_DIRECTION && !direction_valid(_direction))
{
log_error("Direction invalid. direction = %u", _direction);
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_BUILD_FOOTPATH_HERE);