Preserve human manager identity through national coach record swaps (by Codex)

This commit is contained in:
Codex committed 2026-10-29 01:56:31 +01:00
1 parent ce1535fe2d
commit 693744a961
16 files changed
+203 -21

No files matched your search

+8 -1
View File
@@ -89,11 +89,18 @@ struct ModernState : GameState {
bool operator==(const ManagerPresentation&) const = default;
};
std::vector<ManagerPresentation> manager_presentations;
const ManagerPresentation* manager_presentation(int slot) const {
// Runtime slot zero temporarily contains the national coach. These read-only
// mappings recover the human identity and its original/backup record.
int human_manager_slot(int runtime_slot) const;
int manager_record_slot(int human_slot) const;
const ManagerPresentation* manager_presentation_for_human(int slot) const {
if (slot < 0 || size_t(slot) >= manager_ids.size()) return nullptr;
for (const auto& p : manager_presentations) if (p.id == manager_ids[size_t(slot)]) return &p;
return nullptr;
}
const ManagerPresentation* manager_presentation(int runtime_slot) const {
return manager_presentation_for_human(human_manager_slot(runtime_slot));
}
// The press journal (content/press_journal.hpp): business events the almanac cannot give
// (transfers, contracts, toto, seasons, managers), noted once when they happen and saved, so
// the interface's news keep their ids. `data` is the event's facts as JSON text.