Skip to content

Commit

Permalink
Merge pull request #271 from BlckKnght/fix_stagger
Browse files Browse the repository at this point in the history
Fix stagger
  • Loading branch information
DarkFenX committed Apr 28, 2015
2 parents f97b037 + cb1de95 commit a3c19f6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions eos/capSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,25 @@ def reset(self):
if self.scale:
duration, capNeed = self.scale_activation(duration, capNeed)

# set clipSize to infinite if reloads are disabled unless it's
# a cap booster module.
if not self.reload and capNeed > 0:
clipSize = 0

if self.stagger:
duration = int(duration/amount)
if clipSize == 0:
duration = int(duration/amount)
else:
stagger_amount = (duration*clipSize+10000)/(amount*clipSize)
for i in range(1, amount):
heapq.heappush(self.state,
[i*stagger_amount, duration,
capNeed, 0, clipSize])
else:
capNeed *= amount

period = lcm(period, duration)

# set clipSize to infinite if reloads are disabled unless it's
# a cap booster module.
if not self.reload and capNeed > 0:
clipSize = 0

# period optimization doesn't work when reloads are active.
if clipSize:
disable_period = True
Expand Down

0 comments on commit a3c19f6

Please sign in to comment.