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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user