mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix shapely error during mission generation.
It seems shapely doesn't allow `unary_union` on collections any more.
This commit is contained in:
parent
4f04a2d142
commit
2c51e126b7
@ -36,7 +36,13 @@ class AircraftEngagementZones:
|
|||||||
self.threat_zones = self._make_combined_zone()
|
self.threat_zones = self._make_combined_zone()
|
||||||
|
|
||||||
def _make_combined_zone(self) -> ThreatPoly:
|
def _make_combined_zone(self) -> ThreatPoly:
|
||||||
return unary_union(self.individual_zones.values())
|
zones = []
|
||||||
|
for zone in self.individual_zones.values():
|
||||||
|
try:
|
||||||
|
zones.extend(zone.geoms)
|
||||||
|
except AttributeError:
|
||||||
|
zones.append(zone)
|
||||||
|
return unary_union(zones)
|
||||||
|
|
||||||
def covers(self, position: Point) -> bool:
|
def covers(self, position: Point) -> bool:
|
||||||
return self.threat_zones.intersects(dcs_to_shapely_point(position))
|
return self.threat_zones.intersects(dcs_to_shapely_point(position))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user