Read the referee pool from the world (M5, data format F9)

Referees are staff rows with role referee. Imported ones keep their
original property byte; added ones (attributes strictness and the new
perception, 0-3 each) follow the 49 originals in table order, up to 255.
The matchday draw uses the pool size; a second match per day remains the
fallback when the pool runs out. The season sim gains
MODERN_EXTRA_REFEREES=N for testing before data revision 1.4 exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-23 23:28:43 +02:00
1 parent 28b59d9890
commit 57d75ab2f5
8 files changed
+100 -12

No files matched your search

+16
View File
@@ -411,9 +411,25 @@ ExpandReport expand_to_world(ModernState& g, const World& world) {
g.player_last[i] = p->last;
g.player_nation[i] = p->nation;
}
// Referees the data set added (data format F9): their names go to the referee pool and
// their name offsets behind the Classic ones in MasterDatabaseMetadata (u16 per referee).
// install_world_referees adds the matching property bytes to the database.
for (const WorldReferee& r : world.referees) {
if (r.legacy_index >= 0) continue;
const uint16_t at = append_name(g.referee_names, legacy_encoding(r.name));
g.master_database_metadata.push_back(uint8_t(at));
g.master_database_metadata.push_back(uint8_t(at >> 8));
++report.added_referees;
}
if (g.master_database_metadata.size() / 2 > 0xff) fail("more than 255 referees");
return report;
}
void install_world_referees(std::vector<uint8_t>& properties, const World& world) {
for (const WorldReferee& r : world.referees)
if (r.legacy_index < 0) properties.push_back(r.property_byte());
}
} // namespace bmh::modern
namespace bmh::modern {