Change the way dragging from cargo to modules is handled

This commit is contained in:
DarkPhoenix
2019-04-16 02:10:02 +03:00
parent 64bba0cfdb
commit bc4c35665e
3 changed files with 48 additions and 27 deletions

View File

@@ -203,10 +203,13 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
@property
def numCharges(self):
if self.charge is None:
return self.getNumCharges(self.charge)
def getNumCharges(self, charge):
if charge is None:
charges = 0
else:
chargeVolume = self.charge.volume
chargeVolume = charge.volume
containerCapacity = self.item.capacity
if chargeVolume is None or containerCapacity is None:
charges = 0