Skip to content

Commit

Permalink
Wire up menus, default lag compensation to on.
Browse files Browse the repository at this point in the history
  • Loading branch information
roncli committed Mar 5, 2021
1 parent 426b617 commit 3b1b682
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions GameMod/MPClientExtrapolation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static float GetFactor() {

// How far ahead to advance weapons, in seconds.
public static float GetWeaponExtrapolationTime() {
if (MPObserver.Enabled) {
if (MPObserver.Enabled || Menus.mms_lag_compensation == 0 || Menus.mms_lag_compensation == 1) {
return 0f;
}
float time_ms = Math.Min(GameManager.m_local_player.m_avg_ping_ms,
Expand All @@ -64,7 +64,7 @@ public static float GetWeaponExtrapolationTime() {

// How far ahead to advance ships, in seconds.
public static float GetShipExtrapolationTime() {
if (MPObserver.Enabled) {
if (MPObserver.Enabled || Menus.mms_lag_compensation == 0 || Menus.mms_lag_compensation == 2) {
return 0f;
}
float time_ms = Math.Min(GameManager.m_local_player.m_avg_ping_ms,
Expand Down
10 changes: 6 additions & 4 deletions GameMod/Menus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public static void SetLagCompensationDefaults() {
mms_ship_lag_compensation_scale = 100;
mms_lag_compensation_ship_added_lag = 0;
mms_lag_compensation_advanced = false;
mms_lag_compensation = 0;
mms_lag_compensation_strength = 0;
mms_lag_compensation = 3;
mms_lag_compensation_strength = 3;
mms_lag_compensation_use_interpolation = 0;
}

Expand All @@ -113,8 +113,8 @@ public static void SetLagCompensationDefaults() {
public static int mms_ship_lag_compensation_scale = 100;
public static int mms_lag_compensation_ship_added_lag = 0;
public static bool mms_lag_compensation_advanced = false;
public static int mms_lag_compensation = 0;
public static int mms_lag_compensation_strength = 0;
public static int mms_lag_compensation = 3;
public static int mms_lag_compensation_strength = 3;
public static int mms_lag_compensation_use_interpolation = 0;
}

Expand Down Expand Up @@ -434,6 +434,8 @@ private static void LagCompensationUpdate(ref float m_menu_state_timer)
break;
case 4:
Menus.mms_lag_compensation_strength = (Menus.mms_lag_compensation_strength + 4 + UIManager.m_select_dir) % 4;
Menus.mms_weapon_lag_compensation_scale = (int)Math.Round(Menus.mms_lag_compensation_use_interpolation * 100f / 3f, 0);
Menus.mms_ship_lag_compensation_scale = (int)Math.Round(Menus.mms_lag_compensation_use_interpolation * 100f / 3f, 0);
MenuManager.PlayCycleSound(1f, (float)UIManager.m_select_dir);
break;
case 5:
Expand Down

0 comments on commit 3b1b682

Please sign in to comment.