From 75476e0b1d032d8ac32041175eebc1d7910ca3ac Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 8 Jul 2017 18:17:49 +0000 Subject: [PATCH] Simplify D1 Countdown_timer reload --- similar/main/state.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/similar/main/state.cpp b/similar/main/state.cpp index b8f4718b1..15b453eaf 100644 --- a/similar/main/state.cpp +++ b/similar/main/state.cpp @@ -1738,6 +1738,7 @@ int state_restore_all_sub(const char *filename, const secret_restore secret) Control_center_destroyed = PHYSFSX_readSXE32(fp, swap); #if defined(DXX_BUILD_DESCENT_I) Countdown_seconds_left = PHYSFSX_readSXE32(fp, swap); + Countdown_timer = 0; #elif defined(DXX_BUILD_DESCENT_II) Countdown_timer = PHYSFSX_readSXE32(fp, swap); #endif @@ -1751,16 +1752,14 @@ int state_restore_all_sub(const char *filename, const secret_restore secret) control_center_triggers_read(&ControlCenterTriggers, fp); Num_fuelcenters = PHYSFSX_readSXE32(fp, swap); range_for (auto &s, partial_range(Station, Num_fuelcenters)) + { fuelcen_read(fp, s); #if defined(DXX_BUILD_DESCENT_I) - Countdown_timer = 0; - range_for (auto &i, partial_range(Station, Num_fuelcenters)) - { // NOTE: Usually Descent1 handles countdown by Timer value of the Reactor Station. Since we now use Descent2 code to handle countdown (which we do in case there IS NO Reactor Station which causes potential trouble in Multiplayer), let's find the Reactor here and read the timer from it. - if (i.Type == SEGMENT_IS_CONTROLCEN) - Countdown_timer = i.Timer; - } + if (s.Type == SEGMENT_IS_CONTROLCEN) + Countdown_timer = s.Timer; #endif + } // Restore the control cen info Control_center_been_hit = PHYSFSX_readSXE32(fp, swap);