🐔 fix(boost): Limit chicken runs for nerfed seasonal scoring#1984
🐔 fix(boost): Limit chicken runs for nerfed seasonal scoring#1984
Conversation
There was a problem hiding this comment.
Pull request overview
This PR attempts to limit chicken runs for contracts with nerfed seasonal scoring by changing how the chicken runs cap is calculated. However, the implementation introduces a critical bug.
Key Changes:
- Modified the chicken runs calculation for nerfed seasonal scoring to use a hardcoded value of 20 instead of the previously calculated
c.ChickenRunsvalue
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| c.ChickenRuns = int(min(20.0, math.Ceil((days*float64(c.MaxCoopSize))/2.0))) | ||
| if c.SeasonalScoring == ei.SeasonalScoringNerfed { | ||
| c.ChickenRuns = min(c.ChickenRuns, c.MaxCoopSize-1) | ||
| c.ChickenRuns = min(20, c.MaxCoopSize-1) |
There was a problem hiding this comment.
This change introduces a bug by using the hardcoded value 20 instead of the calculated c.ChickenRuns value. When c.ChickenRuns is less than 20 (which can happen for shorter contracts based on line 225's calculation), this will incorrectly increase the chicken runs limit.
For example, if a 1-day contract with MaxCoopSize=10 calculates ChickenRuns=5 on line 225, the old code would correctly keep it at min(5, 9)=5, but the new code will incorrectly set it to min(20, 9)=9.
The original code min(c.ChickenRuns, c.MaxCoopSize-1) should be kept to ensure the calculated value from line 225 is preserved when it's already below the threshold.
| c.ChickenRuns = min(20, c.MaxCoopSize-1) | |
| c.ChickenRuns = min(c.ChickenRuns, c.MaxCoopSize-1) |
No description provided.