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:
ClaudeandClaude committed 2026-11-10 23:16:53 +01:00
1 parent cb6d3b6035
commit d552c59a77
29 files changed
+94 -93

No files matched your search

+2 -2
View File
@@ -215,7 +215,7 @@ void list_club_player(GameState& g, int first, int last, WatcomRandom& rand, Min
n++;
}
}
int pick = 0x8a; // sVar11
int pick = world_layout().league_teams; // sVar11
int slot = -1; // unaff_EDI: the slot tried last
if (n != 0) {
quicksort_by_key(teams, keys, n);
@@ -237,7 +237,7 @@ void list_club_player(GameState& g, int first, int last, WatcomRandom& rand, Min
}
// (when no club had a fitting player the slot tried last is listed all the same)
}
if (pick < 0x8a) {
if (pick < world_layout().league_teams) {
list_player(g, slot, rand, report);
return;
}