From 39de3dc9d4c6f1cdb8f4fdfd6537890327130413 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 12:05:00 +0100 Subject: [PATCH] Allow the national-team desk in the pitch page so the live lineup opens The live lineup of a national-team match failed with 'pitch: unsupported club' because the pitch extras only accepted league club ids. The national desk (runtime club 357, national squad pool) is now accepted under the same condition as the lineup page, uses badge sheet 0 and its own roster base for the marking lookup. Co-Authored-By: Claude Sonnet 5.5 --- src/ui/pitch.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ui/pitch.cpp b/src/ui/pitch.cpp index c9ee6f9..e4fc8c0 100644 --- a/src/ui/pitch.cpp +++ b/src/ui/pitch.cpp @@ -59,9 +59,16 @@ PitchExtras extras(const StaticMemory& memory,const Bytes& managers,const Bytes& const int count=memory.u8(::bmh::layout::ManagerCount); if(count<1||count>4||e.manager_slot>=count||teams.size()!=size_t(count))throw FormatError("pitch: invalid active manager"); e.runtime_club=teams.at(e.manager_slot); - if(e.runtime_club<0||e.runtime_club>=exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField))throw FormatError("pitch: unsupported club"); + // The national-team desk has no club of its own (runtime club kNoTeam) and runs on the + // national pool; the lineup page accepts it under the same condition (see lineup.cpp). + const bool national=e.runtime_club==kNoTeam&&e.manager_slot==0&&count==1&& + ((memory.u32(::bmh::layout::CompetitionSelection)&2)!=0|| + (memory.has(::bmh::layout::CoachActive)&&memory.u8(::bmh::layout::CoachActive)!=0)); + if(e.runtime_club<0||(e.runtime_club>=exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)&&!national)) + throw FormatError("pitch: unsupported club"); const size_t m=size_t(e.manager_slot)*0xb0c,f=size_t(e.manager_slot)*0x160; - if(managers.size()=game.tactics.size())throw FormatError("pitch: truncated own marking rows"); const uint16_t marked=uint16_t(game.tactics[assignment]|uint16_t(game.tactics[assignment+1])<<8); - if(marked==id){const int own_id=game.squad_slots.at(squad_range(e.runtime_club).first+size_t(own))&0x0fff; + if(marked==id){const size_t own_first=e.runtime_club==kNoTeam?size_t(3072):squad_range(e.runtime_club).first; + const int own_id=game.squad_slots.at(own_first+size_t(own))&0x0fff; if(own_id!=0x0fff)opponent.current_marker_player_id=own_id;break;} } e.opponent_players.push_back(std::move(opponent));