Skip to content

Commit

Permalink
Use maxLyEmpty when there's a --full that is False
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Nov 2, 2014
1 parent 51630a6 commit 5983f08
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions commands/commandenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5983f08

Please sign in to comment.