Stop naval control points from being moved onto land (#3373)

This PR fixes #3243 by checking whether the destination point is in the
sea for naval control points before permitting the movement.
This commit is contained in:
zhexu14
2024-04-13 15:04:41 +10:00
committed by GitHub
parent 0ade5b9861
commit c8c78d0b2a
2 changed files with 9 additions and 0 deletions

View File

@@ -89,6 +89,11 @@ def set_destination(
detail=f"Cannot move {cp} more than "
f"{cp.max_move_distance.nautical_miles}nm.",
)
if cp.is_fleet and not game.theater.is_in_sea(point):
raise HTTPException(
status.HTTP_400_BAD_REQUEST,
detail=f"Cannot move naval control point {cp} onto land.",
)
cp.target_position = point
from .. import EventStream