Skip to content

fix: prevent absurd budget usage % on split transition - #323

Open
TtvNekix wants to merge 1 commit into
OpenLeagueManager:developfrom
TtvNekix:fix/budget-recalc
Open

fix: prevent absurd budget usage % on split transition#323
TtvNekix wants to merge 1 commit into
OpenLeagueManager:developfrom
TtvNekix:fix/budget-recalc

Conversation

@TtvNekix

@TtvNekix TtvNekix commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the bug where after transitioning splits (e.g. winter -> spring) the dashboard shows absurd budget usage percentages (e.g. 492%) even when no signings were made.

Root Cause

refresh_hiring_cycle_budgets() recalculated wage_budget as 6% of current cash:

team.wage_budget = ((team.finance.max(0) as f64) * 0.06).round() as i64;

If the team had spent money during the split, their cash was lower, so the new budget became much smaller than the existing wage bill.

Fix

The new wage budget is never set lower than the current annual wage bill:

team.wage_budget = computed.max(annual_wage_bill);

This ensures that a team making no signings will always see budget usage <= 100%.

refresh_hiring_cycle_budgets recalculated wage_budget as 6 % of current cash, which could drop below the existing annual wage bill when the team had spent money during the split. This caused the dashboard to show nonsensical percentages (e.g. 492 % budget usage) when no signings were made.

Fix: the new wage_budget is never set lower than the current annual wage bill. Pre-calculate wage bills before the mutable team loop to satisfy Rust borrow checker.
@TtvNekix TtvNekix changed the title fix: prevent absurd budget usage % on split transition fix: prevent absurd budget usage & Android status bar overlap Jun 13, 2026
@TtvNekix
TtvNekix force-pushed the fix/budget-recalc branch from bf2ae10 to d4293b3 Compare June 13, 2026 01:46
@TtvNekix TtvNekix changed the title fix: prevent absurd budget usage & Android status bar overlap fix: prevent absurd budget usage % on split transition Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant