From 9fe1f8ff90b14147749afc709d276d26337c878e Mon Sep 17 00:00:00 2001 From: Khopa Date: Wed, 14 Oct 2020 23:30:33 +0200 Subject: [PATCH] Now use the new sea map to place boats and offshore buildings. --- theater/conflicttheater.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/theater/conflicttheater.py b/theater/conflicttheater.py index c9013062..4339236b 100644 --- a/theater/conflicttheater.py +++ b/theater/conflicttheater.py @@ -95,11 +95,14 @@ class ConflictTheater: if not self.landmap: return False - for inclusion_zone in self.landmap[0]: - if poly_contains(point.x, point.y, inclusion_zone): - return False + if self.is_on_land(point): + return False - return True + for sea in self.landmap[2]: + if poly_contains(point.x, point.y, sea): + return True + + return False def is_on_land(self, point: Point) -> bool: if not self.landmap: