From 5983f089be404ab4e35a6b8615137224a3aa80ca Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sat, 1 Nov 2014 19:02:41 -0700 Subject: [PATCH] Use maxLyEmpty when there's a --full that is False --- commands/commandenv.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/commands/commandenv.py b/commands/commandenv.py index 6ec9b7cb..3604ecad 100644 --- a/commands/commandenv.py +++ b/commands/commandenv.py @@ -209,8 +209,17 @@ def checkVias(self): def checkShip(self): """ Parse user-specified ship and populate capacity and maxLyPer from it. """ ship = getattr(self._props, 'ship', None) - if ship: - ship = self.ship = self.tdb.lookupShip(ship) - self.capacity = self.capacity or ship.capacity - self.maxLyPer = self.maxLyPer or ship.maxLyFull + if ship is None: + return + + ship = self.ship = self.tdb.lookupShip(ship) + + # Assume we want maxLyFull unless there's a --full that's explicitly False + if getattr(self._props, 'full', True): + shipMaxLy = ship.maxLyFull + else: + shipMaxLy = ship.maxLyEmpty + + self.capacity = self.capacity or ship.capacity + self.maxLyPer = self.maxLyPer or shipMaxLy