mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Remove unused behavior from frontline positioning.
This commit is contained in:
parent
197b9795f8
commit
459c8d02f9
@ -1,6 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from functools import cached_property
|
||||
from typing import Optional, Tuple
|
||||
@ -148,12 +147,11 @@ class FrontLineConflictDescription:
|
||||
max_distance: int,
|
||||
heading: Heading,
|
||||
theater: ConflictTheater,
|
||||
coerce: bool = True,
|
||||
) -> Optional[Point]:
|
||||
"""
|
||||
Finds the nearest valid ground position along a provided heading and it's inverse up to max_distance.
|
||||
`coerce=True` will return the closest land position to `initial` regardless of heading or distance
|
||||
`coerce=False` will return None if a point isn't found
|
||||
"""Finds a valid ground position for the front line center.
|
||||
|
||||
Checks for positions along the front line first. If none succeed, the nearest
|
||||
land position to the initial point is used.
|
||||
"""
|
||||
pos = initial
|
||||
if theater.is_on_land(pos):
|
||||
@ -165,8 +163,6 @@ class FrontLineConflictDescription:
|
||||
pos = initial.point_from_heading(heading.opposite.degrees, distance)
|
||||
if theater.is_on_land(pos):
|
||||
return pos
|
||||
if coerce:
|
||||
pos = theater.nearest_land_pos(initial)
|
||||
return pos
|
||||
logging.error("Didn't find ground position ({})!".format(initial))
|
||||
return None
|
||||
|
||||
pos = theater.nearest_land_pos(initial)
|
||||
return pos
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user