Fixed clients being unable to see vote counts

The clients would check their saved submarines instead of the submarines the server had when receiving the vote count.
This commit is contained in:
Nilanth Animosus
2018-07-21 18:38:27 +01:00
parent cac1c48aa3
commit 5177c5b1eb
@@ -152,7 +152,12 @@ namespace Barotrauma
{
int votes = inc.ReadByte();
string subName = inc.ReadString();
Submarine sub = Submarine.SavedSubmarines.FirstOrDefault(sm => sm.Name == subName);
List<Submarine> serversubs = new List<Submarine>();
foreach (GUIComponent item in GameMain.NetLobbyScreen?.SubList?.children)
{
if (item.UserData != null && item.UserData is Submarine) serversubs.Add(item.UserData as Submarine);
}
Submarine sub = serversubs.FirstOrDefault(sm => sm.Name == subName);
SetVoteText(GameMain.NetLobbyScreen.SubList, sub, votes);
}
}