diff options
author | Aki <please@ignore.pl> | 2022-04-05 23:23:09 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-04-05 23:23:09 +0200 |
commit | 7552ac635c39baae28de9b7c75cdc23d3547168e (patch) | |
tree | 5276ff936da8979859c2d2db93d90e91a3d4ff83 /StarsEx | |
parent | 3b004ab63c16f2eb783e29a35131450ba28383a3 (diff) | |
download | starshatter-7552ac635c39baae28de9b7c75cdc23d3547168e.zip starshatter-7552ac635c39baae28de9b7c75cdc23d3547168e.tar.gz starshatter-7552ac635c39baae28de9b7c75cdc23d3547168e.tar.bz2 |
Fixed campaign saving
Formatting was bad and resulted in crashes or malformed save files.
Avoiding c-style cast is just an addition.
Diffstat (limited to 'StarsEx')
-rw-r--r-- | StarsEx/CampaignSaveGame.cpp | 4 | ||||
-rw-r--r-- | StarsEx/StarSystem.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/StarsEx/CampaignSaveGame.cpp b/StarsEx/CampaignSaveGame.cpp index f4b16ce..b225612 100644 --- a/StarsEx/CampaignSaveGame.cpp +++ b/StarsEx/CampaignSaveGame.cpp @@ -582,8 +582,8 @@ CampaignSaveGame::Save(const char* name) fprintf(f, "unit: \"%s\"\n", player_unit->Name().data()); fprintf(f, "status: %d\n", (int) campaign->GetStatus()); - fprintf(f, "basetime: %f\n", campaign->GetStartTime()); - fprintf(f, "time: %f // %s\n\n", + fprintf(f, "basetime: %Lf\n", campaign->GetStartTime()); + fprintf(f, "time: %Lf // %s\n\n", campaign->GetTime(), timestr); diff --git a/StarsEx/StarSystem.cpp b/StarsEx/StarSystem.cpp index 9d8e377..b31f577 100644 --- a/StarsEx/StarSystem.cpp +++ b/StarsEx/StarSystem.cpp @@ -70,7 +70,7 @@ void StarSystem::CalcStardate() base_time += epoch; } - long double gtime = (long double) Clock::GetInstance()->GameTime() / 1000.0; + long double gtime = Clock::GetInstance()->GameTime<long double>() / 1000.0; long double sdate = gtime + base_time + epoch; stardate = sdate; |