From 21e8b2ffee5796367e91782d1dbae3085114abe4 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Tue, 5 Sep 2017 19:04:58 +0100 Subject: [PATCH] Account for engineers' mods in calculating mass and jump range --- edshipyard.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/edshipyard.py b/edshipyard.py index 03a74ec8..1b693721 100644 --- a/edshipyard.py +++ b/edshipyard.py @@ -76,7 +76,11 @@ def export(data, filename=None): if not module: continue cr = class_rating(module) - mass += module.get('mass', 0) + mods = v.get('modifications') or v.get('WorkInProgress_modifications') or {} + if mods.get('OutfittingFieldType_Mass'): + mass += (module.get('mass', 0) * mods['OutfittingFieldType_Mass']['value']) + else: + mass += module.get('mass', 0) # Specials if 'Fuel Tank'in module['name']: @@ -90,6 +94,11 @@ def export(data, filename=None): if name == 'Frame Shift Drive': fsd = module # save for range calculation + if mods.get('OutfittingFieldType_FSDOptimalMass'): + fsd['optmass'] *= mods['OutfittingFieldType_FSDOptimalMass']['value'] + if mods.get('OutfittingFieldType_MaxFuelPerJump'): + fsd['maxfuel'] *= mods['OutfittingFieldType_MaxFuelPerJump']['value'] + for s in slot_map: if slot.lower().startswith(s):