From ba77ed717aa46b0ade7c890825f5ed0bdac07be9 Mon Sep 17 00:00:00 2001 From: Regalis Date: Wed, 7 Sep 2016 19:59:33 +0300 Subject: [PATCH] Fixed the previous commit (clients don't increment lastUpdateID when changing values in the lobby) --- Subsurface/Source/Screens/NetLobbyScreen.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Subsurface/Source/Screens/NetLobbyScreen.cs b/Subsurface/Source/Screens/NetLobbyScreen.cs index c054f4b3a..9d7d1f684 100644 --- a/Subsurface/Source/Screens/NetLobbyScreen.cs +++ b/Subsurface/Source/Screens/NetLobbyScreen.cs @@ -591,12 +591,12 @@ namespace Barotrauma missionTypeBlock.GetChild().Text = Mission.MissionTypes[missionTypeIndex]; missionTypeBlock.UserData = missionTypeIndex; - - lastUpdateID++; } public bool ToggleMissionType(GUIButton button, object userData) { + if (GameMain.Server == null) return false; + int missionTypeIndex = (int)missionTypeBlock.UserData; missionTypeIndex += (int)userData; @@ -624,7 +624,6 @@ namespace Barotrauma SetTraitorsEnabled((YesNoMaybe)index); - lastUpdateID++; return true; } @@ -648,6 +647,8 @@ namespace Barotrauma private bool SelectSub(GUIComponent component, object obj) { + if (GameMain.Server == null) return false; + lastUpdateID++; var hash = obj is Submarine ? ((Submarine)obj).MD5Hash.Hash : ""; @@ -762,6 +763,7 @@ namespace Barotrauma public bool UpdateServerMessage(GUITextBox textBox, string text) { if (GameMain.Server == null) return false; + lastUpdateID++; return true; @@ -1076,14 +1078,10 @@ namespace Barotrauma private bool SelectSeed(GUITextBox textBox, string seed) { - if (!string.IsNullOrWhiteSpace(seed)) - { - LevelSeed = seed; - } - - //textBox.Text = LevelSeed; - //textBox.Selected = false; + if (GameMain.Server == null) return false; + if (string.IsNullOrWhiteSpace(seed)) return false; + LevelSeed = seed; lastUpdateID++; return true;