Merge branch 'develop_2_3_x' into develop

# Conflicts:
#	changelog.md
#	qt_ui/windows/QLiberationWindow.py
#	resources/campaigns/syria_full_map_remastered.json
This commit is contained in:
Khopa
2020-12-18 00:23:53 +01:00
21 changed files with 305 additions and 400 deletions

View File

@@ -142,6 +142,7 @@ from dcs.task import (
SEAD,
Task,
Transport,
RunwayAttack,
)
from dcs.terrain.terrain import Airport
from dcs.unit import Ship, Unit, Vehicle
@@ -823,6 +824,8 @@ UNIT_BY_TASK = {
Armor.StuG_III_Ausf__G,
Artillery.M12_GMC,
Artillery.Sturmpanzer_IV_Brummbär,
Armor.Daimler_Armoured_Car,
Armor.LT_Mk_VII_Tetrarch,
Artillery.MLRS_M270,
Artillery.SPH_M109_Paladin,
@@ -986,6 +989,7 @@ COMMON_OVERRIDE = {
AntishipStrike: "ANTISHIP",
GroundAttack: "STRIKE",
Escort: "CAP",
RunwayAttack: "RUNWAY_ATTACK"
}
PLANE_PAYLOAD_OVERRIDES: Dict[Type[PlaneType], Dict[Type[Task], str]] = {

View File

@@ -9,6 +9,9 @@ from itertools import tee
from pathlib import Path
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Union, cast
from shapely import geometry
from shapely import ops
from dcs import Mission
from dcs.countries import (
CombinedJointTaskForcesBlue,
@@ -472,6 +475,34 @@ class ConflictTheater:
return True
def nearest_land_pos(self, point: Point, extend_dist: int = 50) -> Point:
"""Returns the nearest point inside a land exclusion zone from point
`extend_dist` determines how far inside the zone the point should be placed"""
if self.is_on_land(point):
return point
point = geometry.Point(point.x, point.y)
nearest_points = []
if not self.landmap:
raise RuntimeError("Landmap not initialized")
for inclusion_zone in self.landmap[0]:
nearest_pair = ops.nearest_points(point, inclusion_zone)
nearest_points.append(nearest_pair[1])
min_distance = point.distance(nearest_points[0]) # type: geometry.Point
nearest_point = nearest_points[0] # type: geometry.Point
for pt in nearest_points[1:]:
distance = point.distance(pt)
if distance < min_distance:
min_distance = distance
nearest_point = pt
assert isinstance(nearest_point, geometry.Point)
point = Point(point.x, point.y)
nearest_point = Point(nearest_point.x, nearest_point.y)
new_point = point.point_from_heading(
point.heading_between_point(nearest_point),
point.distance_to_point(nearest_point) + extend_dist
)
return new_point
def player_points(self) -> List[ControlPoint]:
return [point for point in self.controlpoints if point.captured]

View File

@@ -2,7 +2,7 @@ from pathlib import Path
def _build_version_string() -> str:
components = ["2.3.0"]
components = ["2.3.1"]
build_number_path = Path("resources/buildnumber")
if build_number_path.exists():
with build_number_path.open("r") as build_number_file: