Fixed networkevents crashing due to client trying to access server.connectedclients

This commit is contained in:
Regalis
2016-02-19 17:18:31 +02:00
parent 9cfbbb44ed
commit c605adf879
10 changed files with 54 additions and 25 deletions
+3 -4
View File
@@ -394,8 +394,10 @@ namespace Barotrauma
TryPutItem(item, item.AllowedSlots, false);
if (droppedItems.Contains(item)) droppedItems.Remove(item);
}
lastUpdate = sendingTime;
if (GameMain.Server == null) return;
var sender = GameMain.Server.ConnectedClients.Find(c => c.Connection == message.SenderConnection);
if (sender != null && sender.Character != null)
{
@@ -410,9 +412,6 @@ namespace Barotrauma
GameServer.Log(sender.Character + " placed " + item.Name + " in " + Owner.ToString(), Color.Orange);
}
}
lastUpdate = sendingTime;
}
}
}