diff --git a/common/main/game.h b/common/main/game.h index b787cd585..450756808 100644 --- a/common/main/game.h +++ b/common/main/game.h @@ -179,6 +179,7 @@ struct d_game_unique_state : ::dcx::d_game_unique_state struct d_level_shared_seismic_state { fix Level_shake_frequency; + fix Level_shake_duration; }; struct d_level_unique_seismic_state diff --git a/common/main/gamemine.h b/common/main/gamemine.h index e5af0741b..fa2714c4e 100644 --- a/common/main/gamemine.h +++ b/common/main/gamemine.h @@ -148,7 +148,6 @@ int load_mine_data_compiled(PHYSFS_File *LoadFile, const char *Gamesave_current_ #if defined(DXX_BUILD_DESCENT_II) namespace dsx { extern int d1_pig_present; -extern fix Level_shake_duration; extern segnum_t Secret_return_segment; extern vms_matrix Secret_return_orient; diff --git a/similar/main/gamemine.cpp b/similar/main/gamemine.cpp index 775036bb9..29823eebe 100644 --- a/similar/main/gamemine.cpp +++ b/similar/main/gamemine.cpp @@ -85,7 +85,6 @@ static void segment2_read(shared_segment &s2, unique_segment &u2, PHYSFS_File *f #if defined(DXX_BUILD_DESCENT_I) #elif defined(DXX_BUILD_DESCENT_II) -fix Level_shake_duration = 0; segnum_t Secret_return_segment; vms_matrix Secret_return_orient; @@ -493,12 +492,12 @@ int load_mine_data(PHYSFS_File *LoadFile) #if defined(DXX_BUILD_DESCENT_II) if (mine_top_fileinfo.fileinfo_version < 18) { LevelSharedSeismicState.Level_shake_frequency = 0; - Level_shake_duration = 0; + LevelSharedSeismicState.Level_shake_duration = 0; Secret_return_segment = segment_first; Secret_return_orient = vmd_identity_matrix; } else { LevelSharedSeismicState.Level_shake_frequency = mine_fileinfo.level_shake_frequency << 12; - Level_shake_duration = mine_fileinfo.level_shake_duration << 12; + LevelSharedSeismicState.Level_shake_duration = mine_fileinfo.level_shake_duration << 12; Secret_return_segment = mine_fileinfo.secret_return_segment; Secret_return_orient = mine_fileinfo.secret_return_orient; } diff --git a/similar/main/weapon.cpp b/similar/main/weapon.cpp index 8eb901af5..4dde7b71e 100644 --- a/similar/main/weapon.cpp +++ b/similar/main/weapon.cpp @@ -1131,7 +1131,7 @@ void init_seismic_disturbances() // Return true if time to start a seismic disturbance. static bool seismic_disturbance_active() { - const auto level_shake_duration = Level_shake_duration; + const auto level_shake_duration = LevelSharedSeismicState.Level_shake_duration; if (level_shake_duration < 1) return false; @@ -1158,7 +1158,7 @@ static void seismic_disturbance_frame(void) if (seismic_disturbance_active()) { int fc, rx, rz; fix delta_time = static_cast(GameTime64 - LevelUniqueSeismicState.Seismic_disturbance_end_time); - fc = abs(delta_time - Level_shake_duration / 2); + fc = abs(delta_time - LevelSharedSeismicState.Level_shake_duration / 2); fc /= F1_0/16; if (fc > 16) fc = 16;