Unstable 0.1300.0.4

This commit is contained in:
Markus Isberg
2021-03-30 15:51:49 +03:00
parent 58c50a235d
commit 862221635c
108 changed files with 907 additions and 378 deletions
@@ -65,7 +65,7 @@ namespace Barotrauma
public void ServerRead(IReadMessage inc, Client sender)
{
if (GameMain.Server == null || sender == null) return;
if (GameMain.Server == null || sender == null) { return; }
byte voteTypeByte = inc.ReadByte();
VoteType voteType = VoteType.Unknown;
@@ -83,7 +83,10 @@ namespace Barotrauma
{
case VoteType.Sub:
int equalityCheckVal = inc.ReadInt32();
SubmarineInfo sub = SubmarineInfo.SavedSubmarines.FirstOrDefault(s => s.EqualityCheckVal == equalityCheckVal);
string hash = equalityCheckVal > 0 ? string.Empty : inc.ReadString();
SubmarineInfo sub = equalityCheckVal > 0 ?
SubmarineInfo.SavedSubmarines.FirstOrDefault(s => s.Type == SubmarineType.Player && s.EqualityCheckVal == equalityCheckVal) :
SubmarineInfo.SavedSubmarines.FirstOrDefault(s => s.Type == SubmarineType.Player && s.MD5Hash.Hash == hash);
sender.SetVote(voteType, sub);
break;
case VoteType.Mode: