Show proper warp time even when various modules which reduce ship speed to 0 are active
This commit is contained in:
@@ -156,9 +156,9 @@ class FitGraph(metaclass=ABCMeta):
|
||||
|
||||
# Calculation stuff
|
||||
def _calcPlotPoints(self, mainInput, miscInputs, xSpec, ySpec, fit, tgt):
|
||||
mainParam, miscParams = self._normalizeParams(mainInput, miscInputs, fit, tgt)
|
||||
mainParam, miscParams = self._limitParams(mainParam, miscParams, fit, tgt)
|
||||
xs, ys = self._getPoints(mainParam, miscParams, xSpec, ySpec, fit, tgt)
|
||||
mainParam, miscParams = self._normalizeInputs(mainInput=mainInput, miscInputs=miscInputs, fit=fit, tgt=tgt)
|
||||
mainParam, miscParams = self._limitParams(mainParam=mainParam, miscParams=miscParams, fit=fit, tgt=tgt)
|
||||
xs, ys = self._getPoints(mainParam=mainParam, miscParams=miscParams, xSpec=xSpec, ySpec=ySpec, fit=fit, tgt=tgt)
|
||||
ys = self._denormalizeValues(ys, ySpec, fit, tgt)
|
||||
# Sometimes x denormalizer may fail (e.g. during conversion of 0 ship speed to %).
|
||||
# If both inputs and outputs are in %, do some extra processing to at least have
|
||||
@@ -182,7 +182,7 @@ class FitGraph(metaclass=ABCMeta):
|
||||
|
||||
_normalizers = {}
|
||||
|
||||
def _normalizeParams(self, mainInput, miscInputs, fit, tgt):
|
||||
def _normalizeInputs(self, mainInput, miscInputs, fit, tgt):
|
||||
key = (mainInput.handle, mainInput.unit)
|
||||
if key in self._normalizers:
|
||||
normalizer = self._normalizers[key]
|
||||
|
||||
@@ -89,8 +89,19 @@ class SubwarpSpeedCache(FitDataCache):
|
||||
subwarpSpeed = self._data[fit.ID]
|
||||
except KeyError:
|
||||
modStates = {}
|
||||
disallowedGroups = (
|
||||
# Active modules which affect ship speed and cannot be used in warp
|
||||
'Propulsion Module',
|
||||
'Mass Entanglers',
|
||||
'Cloaking Device',
|
||||
# Those reduce ship speed to 0
|
||||
'Siege Module',
|
||||
'Super Weapon',
|
||||
'Cynosural Field Generator',
|
||||
'Clone Vat Bay',
|
||||
'Jump Portal Generator')
|
||||
for mod in fit.modules:
|
||||
if mod.item is not None and mod.item.group.name in ('Propulsion Module', 'Mass Entanglers', 'Cloaking Device') and mod.state >= FittingModuleState.ACTIVE:
|
||||
if mod.item is not None and mod.item.group.name in disallowedGroups and mod.state >= FittingModuleState.ACTIVE:
|
||||
modStates[mod] = mod.state
|
||||
mod.state = FittingModuleState.ONLINE
|
||||
projFitStates = {}
|
||||
|
||||
Reference in New Issue
Block a user