From 178ae3774ec629b89b32f83d3e95140cdcae9523 Mon Sep 17 00:00:00 2001 From: RndName Date: Sat, 26 Mar 2022 12:47:02 +0100 Subject: [PATCH] Support campaign version 10.0 for Liberation 5.2.0 - add a new const to the version.py to allow future campaign version to be backwards compatible - Version 10.0 was only about orientation of ground objects which does not break the compatibility so we can give support for this specific version --- game/campaignloader/campaign.py | 4 ++-- game/version.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/game/campaignloader/campaign.py b/game/campaignloader/campaign.py index e14d6476..55e0927e 100644 --- a/game/campaignloader/campaign.py +++ b/game/campaignloader/campaign.py @@ -22,7 +22,7 @@ from game.theater import ( SyriaTheater, MarianaIslandsTheater, ) -from game.version import CAMPAIGN_FORMAT_VERSION +from game.version import CAMPAIGN_FORMAT_VERSION, SUPPORTED_CAMPAIGN_VERSION from .campaignairwingconfig import CampaignAirWingConfig from .mizcampaignloader import MizCampaignLoader from .. import persistency @@ -147,7 +147,7 @@ class Campaign: @property def is_from_future(self) -> bool: """Returns True if this campaign is newer than the supported format.""" - return self.version > CAMPAIGN_FORMAT_VERSION + return self.version > SUPPORTED_CAMPAIGN_VERSION @property def is_compatible(self) -> bool: diff --git a/game/version.py b/game/version.py index e0aa18fe..22172724 100644 --- a/game/version.py +++ b/game/version.py @@ -124,3 +124,6 @@ VERSION = _build_version_string() #: * Campaign files can optionally define a start date with #: `recommended_start_date: YYYY-MM-DD`. CAMPAIGN_FORMAT_VERSION = (9, 1) + +# Version 5.2.0 of DCS Liberation also supports Campaigns of Version 10.0 +SUPPORTED_CAMPAIGN_VERSION = (10, 0)