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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -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.

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