From 8075317536783ca6e9042f506602a0eb98fc727f Mon Sep 17 00:00:00 2001 From: cim Date: Wed, 31 Dec 2014 17:28:41 +0000 Subject: [PATCH] Fix for importing old post-nova savegames --- src/Core/OOSystemDescriptionManager.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Core/OOSystemDescriptionManager.m b/src/Core/OOSystemDescriptionManager.m index 13edbb8e..b68ff1a0 100644 --- a/src/Core/OOSystemDescriptionManager.m +++ b/src/Core/OOSystemDescriptionManager.m @@ -286,6 +286,18 @@ static NSString *kOOSystemLayerProperty = @"layer"; toValue:[legacyChanges objectForKey:propertyKey] fromManifest:defaultManifest]; } + /* Fix for older savegames not having a larger sun radius + * property set from the Nova mission. */ + id sr = [self getProperty:@"sun_radius" forSystemKey:systemKey]; + float sr_num = [sr floatValue]; + if (sr_num < 600000) { + // fix sun radius values + [self setProperty:@"sun_radius" + forSystemKey:systemKey + andLayer:OO_LAYER_OXP_DYNAMIC + toValue:[NSNumber numberWithFloat:sr_num+600000.0] + fromManifest:defaultManifest]; + } } }