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
@@ -320,6 +320,8 @@ namespace Barotrauma.Items.Components
{
Use(1.0f);
if (GameMain.Server == null) return;
var sender = GameMain.Server.ConnectedClients.Find(c => c.Connection == message.SenderConnection);
if (sender != null && sender.Character != null)
{
@@ -577,7 +577,6 @@ namespace Barotrauma.Items.Components
lastUpdate = sendingTime;
if (GameMain.Server == null) return;
var sender = GameMain.Server.ConnectedClients.Find(c => c.Connection == message.SenderConnection);