This commit is contained in:
2026-07-04 16:57:40 -07:00
parent 16e396841e
commit c6b7890212
47 changed files with 1713 additions and 209 deletions
@@ -27,7 +27,7 @@ namespace ProjectM.Simulation
// field 0-defaults and the restore guard maps 0 -> baked Max); v0/v1 garbage is still rejected.
if (data == null || data.Version < SaveData.MinLoadableVersion || data.Version > SaveData.CurrentVersion) return null;
data.Ledger ??= Array.Empty<LedgerRow>();
data.MetaUpgrades ??= Array.Empty<MetaUpgradeSave>(); // v6: null on any v<=5 file();
data.MetaUpgrades ??= Array.Empty<MetaUpgradeSave>(); // v6: null on any v<=5 file
return data;
}
catch (Exception e)
@@ -37,6 +37,22 @@ namespace ProjectM.Simulation
}
}
/// <summary>
/// A TERMINAL save (Victory/Loss latched) Continues as a FRESH CAMPAIGN that keeps the base + permanent
/// meta: the outcome latch, goal meter, and core integrity reset to 0 (the spawn restore guards re-map
/// 0 -> InProgress / empty meter / baked-full Core), while meta tiers, run counters, the ledger, and
/// placed structures survive untouched. Without this, Continue/PLAY AGAIN after a win re-latches the dead
/// outcome banner on the first replicated snapshot. Pure + idempotent; no-op for in-progress saves.
/// </summary>
public static void RollTerminalCampaignForward(SaveData data)
{
if (data == null || data.RunOutcome == 0) return;
data.RunOutcome = 0;
data.GoalCharge = 0;
data.CoreCurrent = 0;
}
public static void Save(SaveData data)
{
if (data == null) return;