Almanac: record the matches of the German national team
The German national team shares its team number 357 with no_team, and the recorder skipped it as a placeholder, so no international match of Germany reached the almanac. Its line-up comes from the national squad while a human is the national coach, as in the match engine. modern_season_sim MODERN_ALMANAC_TEAM=<name> lists a team's recorded matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
85359a136f
commit
ddaebec183
5 files changed
+19
-7
No files matched your search
@@ -14,6 +14,7 @@
|
||||
#include "modern/game/cup.hpp"
|
||||
#include "modern/game/matchday.hpp"
|
||||
#include "modern/game/modern_state.hpp"
|
||||
#include "modern/game/national.hpp"
|
||||
|
||||
namespace bmh::modern {
|
||||
|
||||
@@ -398,7 +399,7 @@ AlmanacRecorder::AlmanacRecorder(ModernState& g, const std::vector<MatchGroup>&
|
||||
if (f + 1 >= group.fixtures.size()) continue;
|
||||
const int home = group.fixtures[f], away = group.fixtures[f + 1];
|
||||
const int teams = world_layout().total_teams();
|
||||
if (home < 0 || away < 0 || home >= teams || away >= teams || home == no_team() || away == no_team()) continue;
|
||||
if (home < 0 || away < 0 || home >= teams || away >= teams) continue;
|
||||
Running r;
|
||||
r.group = gi, r.match = m;
|
||||
AlmanacMatch& rec = r.record;
|
||||
@@ -435,7 +436,10 @@ 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;
|
||||
if (team >= league_clubs()) continue; // only league clubs have squads
|
||||
// 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;
|
||||
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);
|
||||
@@ -465,7 +469,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()) return out;
|
||||
if (team < 0 || (team >= league_clubs() && (team != no_team() || !national_coach_active(g_)))) 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);
|
||||
|
||||
Reference in new issue
Block a user