Don't allow carrier's path over land in UI

This commit is contained in:
Raffson
2024-12-28 01:02:40 +01:00
parent cf38113cde
commit 592b1a7833
2 changed files with 14 additions and 1 deletions

View File

@@ -89,6 +89,15 @@ def set_destination(
detail=f"Cannot move {cp} more than "
f"{cp.max_move_distance.nautical_miles}nm.",
)
if (
cp.is_fleet
and game.theater.landmap
and game.theater.landmap.land_inbetween(cp.position, point)
):
raise HTTPException(
status.HTTP_400_BAD_REQUEST,
detail=f"Cannot move {cp} over land.",
)
cp.target_position = point
from .. import EventStream