Add the base read queries for the new UI; fix ages and save limits
- ModernSession::read(request): status, leagues, table, fixtures and squad as JSON with the same club/player/league objects everywhere (docs/new_engine/ui-abfragen.md); the statistics answer through it. Further queries follow per menu once the GUI is finished. - Ages: data set 1.3 gives ages only for the 840 added players (birth dates); the 2574 original players carry the placeholder 16 and now get their age drawn as in the original (human squad 20-25) instead of all being 16. Birth dates for all players go into data 1.4. - Saves of Modern matchdays with more than six match groups (nine leagues on one day) were refused on loading; Classic keeps six. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f92be693af
commit
4639fe5a91
12 files changed
+344
-8
No files matched your search
@@ -305,6 +305,10 @@ ExpandReport expand_to_world(ModernState& g, const World& world) {
|
||||
else
|
||||
++report.fallback_nationalities;
|
||||
const int age = std::clamp(p.age < 0 ? 24 : p.age, 16, 47);
|
||||
if (p.age >= 0) { // a birth date: the career start keeps this age (balance.md)
|
||||
if (g.world_age_known.size() < size_t(next_player)) g.world_age_known.resize(size_t(next_player), false);
|
||||
g.world_age_known[i] = true;
|
||||
}
|
||||
Player& pl = g.players[i];
|
||||
pl.w35c = clamp7(p.form) | clamp7(p.technique) << 7 | clamp7(p.condition) << 14;
|
||||
pl.w368 = skill(p.teamplay) | skill(p.speed) << 2 | skill(p.shooting) << 4 | skill(p.passing) << 6 |
|
||||
|
||||
Reference in new issue
Block a user