Cap Enforcer Deep Dive: Injury Swaps, Roster Trim & User Safety Net
A deep dive into the salary cap enforcer: a local test save (Game 206, season 3, week 1) exposed players the enforcer was silently missing — leaving teams with up to 58 actives against a 53-man limit and a negative cap space of over 26M. This round introduces three new enforcer phases, shields user teams from unwanted releases, and closes a stubborn blind spot in the roster query.
🔍 The Enforcer Blind Spot
- The enforcer's roster query was filtering
AND karriereende=0 AND draft!=2— well-intentioned, but the salary-paying columnteam.salarycapcounts every player - Result: the enforcer saw 53 players against a real roster size of 58 and calculated ~189M in salaries while the true total was 228.7M
- Fix: filter removed, enforcer now sees the full reality — including players with imminent retirement or the draft-in-progress flag
🏥 Phase 0A: Injury Swaps
- New phase that runs before the roster trim: injured active players get swapped 1:1 with the strongest healthy non-retired PS player at the same position
- Runs in a loop until no more swaps are possible — stable even with multiple injuries per team
- Phase 2 (promotion) now explicitly skips injured and retiring PS players so they never get pulled back up
📉 Phase 0: Roster Trim to maxroster (53)
- Explicit demote-to-PS logic when roster size >
maxroster, demoting the highest-paid over-optimal players first - Fallback: if no position is over its optimal, it demotes from positions above
min_lineup— guaranteeing a playable roster - Resolves the 58/53 case (6 CB at optimum 5, 5 QB at optimum 3, 2 P at optimum 1) in a single pass
🛡️ User-Team Safety Net (no releases!)
- New
$no_release_tidsparameter onenforce_cpu_salary_cap()— teams on this list may only be demoted to PS by the enforcer, never released - The user team is always added to this list when
depthchart_mode != 'manual': releases stay strictly a user-driven action - New action branch
act_demote_above_minkicks in when other actions are blocked for protected teams
🎚️ Depth Chart Mode Toggle as Trigger
- Switching from
manualto any auto sort (e.g. "Strength descending") now triggers the optimizer + cap enforcement so the roster lands under the cap immediately — with zero user releases - Language key
autosort_auto_disabled_hintrefined: "…switch the mode above or in the side menu to „Manual""
The enforcer is markedly more precise now, user teams can no longer lose players unwillingly, and injured players land where they belong — on the practice / injury squad. A big step forward for the balance of all franchise modes.