Team id comparisons ask the world layout
92 comparisons against the raw numbers 138, 168 and 357 in engine, UI and app read world_layout().league_teams, first_foreign_cup() and no_team(); a team id written as 0x165 is kNoTeam. Same values, same arithmetic. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
cb6d3b6035
commit
d552c59a77
29 files changed
+94
-93
No files matched your search
@@ -178,7 +178,7 @@ StrengthsProjection strengths_from_game(const GameState& game, int manager_slot,
|
||||
|
||||
const int first = league_first_team(league);
|
||||
const int size = league_system().sizes[league];
|
||||
if (first < 0 || first + size > 138) invalid("league bounds exceed domestic club table");
|
||||
if (first < 0 || first + size > world_layout().league_teams) invalid("league bounds exceed domestic club table");
|
||||
if (game.club_ids.size() < size_t(first + size)) invalid("club ID table is truncated");
|
||||
if (game.club_names.empty()) invalid("club name pool is empty");
|
||||
for (int team = first; team < first + size; ++team) {
|
||||
|
||||
Reference in new issue
Block a user