diff --git a/eos/mathUtils.py b/eos/mathUtils.py deleted file mode 100644 index 5de12c60f..000000000 --- a/eos/mathUtils.py +++ /dev/null @@ -1,31 +0,0 @@ -# =============================================================================== -# Copyright (C) 2010 Anton Vorobyov -# -# This file is part of eos. -# -# eos is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# eos is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with eos. If not, see . -# =============================================================================== - -import decimal - - -def floorFloat(value): - """Round float down to integer""" - # We have to convert float to str to keep compatibility with - # decimal module in python 2.6 - value = str(value) - # Do the conversions for proper rounding down, avoiding float - # representation errors - result = int(decimal.Decimal(value).to_integral_value(rounding=decimal.ROUND_DOWN)) - return result diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 113ff98b5..de6e8cc58 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -1159,8 +1159,8 @@ class Fit(object): @property def remoteReps(self): force_recalc = False - for remoterep_type in self.__remoteReps: - if self.__remoteReps[remoterep_type] is None: + for remote_type in self.__remoteReps: + if self.__remoteReps[remote_type] is None: force_recalc = True break diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 55da98d63..a3f85ed5b 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -25,7 +25,6 @@ from math import floor import eos.db from eos.effectHandlerHelpers import HandledItem, HandledCharge from eos.enum import Enum -from eos.mathUtils import floorFloat from eos.modifiedAttributeDict import ModifiedAttributeDict, ItemAttrShortcut, ChargeAttrShortcut from eos.saveddata.citadel import Citadel @@ -233,7 +232,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): chance = self.getModifiedChargeAttr("crystalVolatilityChance") damage = self.getModifiedChargeAttr("crystalVolatilityDamage") crystals = self.numCharges - numShots = floorFloat(float(crystals * hp) / (damage * chance)) + numShots = floor((crystals * hp) / (damage * chance)) else: # Set 0 (infinite) for permanent crystals like t1 laser crystals numShots = 0