Modern: national teams play with squads of their nationality (M9)

A Modern layout gives every national team after no_team 24 squad slots.
On each national team day, after the German nomination, the strongest fit
players of each nationality (quotas 3/5/7/5, the German strength measure)
fill its squad and get a computer line-up; a nation without a goalkeeper
or with fewer than 14 nominees keeps its drawn rating. The shared match
core asks fields_players() instead of 'league club or no_team', which is
the same set in Classic. National squads get no cards or injuries, their
players develop after the match like Germany's, and the almanac records
their line-ups.

Diamond data 1.5: 24 of 61 nations play with players. Classic regression
(game 1 and two-player) unchanged, Classic-data season identical, save
round trip identical, ctest passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-25 15:02:50 +01:00
1 parent 96e88c9579
commit 0f36b507d4
17 files changed
+154 -22

No files matched your search

+4 -6
View File
@@ -15,7 +15,6 @@
#include "modern/game/cup.hpp"
#include "modern/game/matchday.hpp"
#include "modern/game/modern_state.hpp"
#include "modern/game/national.hpp"
namespace bmh::modern {
@@ -539,10 +538,9 @@ AlmanacRecorder::AlmanacRecorder(ModernState& g, const std::vector<MatchGroup>&
if (const int ref = group.desc.at(0x10 + size_t(m)); ref > 0) rec.referee = season.referee(referee_name(g, ref));
for (int side = 0; side < 2; ++side) {
const int team = side ? away : home;
// only the league clubs and the German national team (no_team, squad nominated on the
// national team days, used only while a human is the national coach, as in the match engine) have
// squads; the other national and amateur teams play without players
if (team >= league_clubs() && (team != no_team() || !national_coach_active(g))) continue;
// the teams that play with their players (fields_players: the league clubs and the
// national teams with a nominated squad); the others play with a drawn rating
if (!fields_players(g, team)) continue;
const SquadRange range = squad_range(team);
for (size_t s = 0; s < range.count; ++s) {
const uint16_t e = g.squad_slots.at(range.first + s);
@@ -572,7 +570,7 @@ uint16_t AlmanacRecorder::player_ref(int player) {
// sent off or injured loses it; a substitute takes the slot of the player he replaces).
std::vector<uint16_t> AlmanacRecorder::on_pitch(int team) const {
std::vector<uint16_t> out;
if (team < 0 || (team >= league_clubs() && (team != no_team() || !national_coach_active(g_)))) return out;
if (team < 0 || !fields_players(g_, team)) return out;
const SquadRange range = squad_range(team);
for (size_t s = 0; s < std::min<size_t>(11, range.count); ++s) {
const uint16_t e = g_.squad_slots.at(range.first + s);