From 3e249ec15517b381128ba50334e9639c3b8a189d Mon Sep 17 00:00:00 2001 From: MaruMaruOO Date: Fri, 28 Sep 2018 23:36:18 -0400 Subject: [PATCH] Minor lint and EFS export maxRange bug fix. --- service/efsPort.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/service/efsPort.py b/service/efsPort.py index ed26fefa9..ef224e850 100755 --- a/service/efsPort.py +++ b/service/efsPort.py @@ -91,12 +91,10 @@ class EfsPort(): oldPropState = propWithBloom.state propWithBloom.state = State.ONLINE sFit.recalc(fit) - fit = eos.db.getFit(fitID) sp = fit.maxSpeed sig = fit.ship.getModifiedItemAttr("signatureRadius") propWithBloom.state = oldPropState sFit.recalc(fit) - fit = eos.db.getFit(fitID) return {"usingMWD": True, "unpropedSpeed": sp, "unpropedSig": sig} return { "usingMWD": False, @@ -323,10 +321,13 @@ class EfsPort(): explosionRadius = 0 explosionVelocity = 0 aoeFieldRange = 0 + if stats.charge: + name = stats.item.name + ", " + stats.charge.name + else: + name = stats.item.name if stats.hardpoint == Hardpoint.TURRET: tracking = stats.getModifiedItemAttr("trackingSpeed") typeing = "Turret" - name = stats.item.name + ", " + stats.charge.name # Bombs share most attributes with missiles despite not needing the hardpoint elif stats.hardpoint == Hardpoint.MISSILE or "Bomb Launcher" in stats.item.name: maxVelocity = stats.getModifiedChargeAttr("maxVelocity") @@ -335,15 +336,18 @@ class EfsPort(): explosionRadius = stats.getModifiedChargeAttr("aoeCloudSize") explosionVelocity = stats.getModifiedChargeAttr("aoeVelocity") typeing = "Missile" - name = stats.item.name + ", " + stats.charge.name elif stats.hardpoint == Hardpoint.NONE: aoeFieldRange = stats.getModifiedItemAttr("empFieldRange") # This also covers non-bomb weapons with dps values and no hardpoints, most notably targeted doomsdays. typeing = "SmartBomb" - name = stats.item.name + # Targeted DDs are the only non drone/fighter weapon without an explict max range + if stats.item.group.name == 'Super Weapon' and stats.maxRange == None: + maxRange = 300000 + else: + maxRange = stats.maxRange statDict = { "dps": stats.dps * n, "capUse": stats.capUse * n, "falloff": stats.falloff, - "type": typeing, "name": name, "optimal": stats.maxRange, + "type": typeing, "name": name, "optimal": maxRange, "numCharges": stats.numCharges, "numShots": stats.numShots, "reloadTime": stats.reloadTime, "cycleTime": stats.cycleTime, "volley": stats.volley * n, "tracking": tracking, "maxVelocity": maxVelocity, "explosionDelay": explosionDelay, "damageReductionFactor": damageReductionFactor,