Skip to content

Commit

Permalink
Issue #51 L and ? items weren't honoring qty limits
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Nov 1, 2014
1 parent 0e935c2 commit 159b15c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ files from other commanders to fill out your database.

v5.0.1 In Progress
. (kfsone) Issue #49 Errors in Ambiguity Error
. (kfsone) Issue #51 L and ? items weren't honoring qty limits

v5.0.0 Oct 31/2014
. (kfsone) Initial Beta 3 changes
Expand Down
7 changes: 5 additions & 2 deletions tradecalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,11 @@ def _fitCombos(offset, cr, cap):
# 1 unit per 15 minutes for medium
units = level - 1
interval = (30 / level) * 60
adjustment = units * math.floor(item.srcAge / interval)
maxQty = min(maxQty, item.stock + adjustment)
speculativeRecovery = units * math.floor(item.srcAge / interval)
else:
# Low / Unknown - don't try to guess
speculativeRecovery = 0
maxQty = min(maxQty, item.stock + speculativeRecovery)

if maxQty > 0:
itemGain = item.gainCr
Expand Down

0 comments on commit 159b15c

Please sign in to comment.