From c8c78d0b2aa61f291f00ac03b812d8d46a0d595f Mon Sep 17 00:00:00 2001 From: zhexu14 <64713351+zhexu14@users.noreply.github.com> Date: Sat, 13 Apr 2024 15:04:41 +1000 Subject: [PATCH] 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. --- changelog.md | 4 ++++ game/server/controlpoints/routes.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/changelog.md b/changelog.md index ae41b8d4..0c92026f 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,10 @@ Saves from 11.x are not compatible with 12.0.0. ## Fixes +* **[Campaign]** Fixed double counting of parked aircraft kills when DCS reports multiple kill events. +* **[UI]** Naval control points (carriers, LHAs) can no longer be moved onto land. + + # 11.0.0 Saves from 10.x are not compatible with 11.0.0. diff --git a/game/server/controlpoints/routes.py b/game/server/controlpoints/routes.py index b1c8f9ed..56f236e1 100644 --- a/game/server/controlpoints/routes.py +++ b/game/server/controlpoints/routes.py @@ -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