Invert the random location warning.

Campaigns should no longer be using these. Remove the warning when a
location cannot be found, and emit a warning when they are used.
This commit is contained in:
Dan Albert 2021-05-18 19:36:20 -07:00
parent 242f00390d
commit a3cce8ff72

View File

@ -152,13 +152,14 @@ class LocationFinder:
def location_for(self, location_type: LocationType) -> Optional[PointWithHeading]:
position = self.control_point.preset_locations.random_for(location_type)
if position is not None:
logging.warning(
f"Campaign relies on random generation of %s at %s. Support for random "
"objectives will be removed soon.",
location_type.value,
self.control_point,
)
return position
logging.warning(
f"No campaign location for %s at %s",
location_type.value,
self.control_point,
)
return None