Stricter item interaction check

This commit is contained in:
juanjp600
2016-08-28 20:00:46 -03:00
parent 73fc0cf724
commit 86704c7d83

View File

@@ -1722,16 +1722,21 @@ namespace Barotrauma
Condition = (float)message.ReadByte()/2.55f;
switch (type)
Client sender = null;
if (GameMain.Server != null)
{
sender = GameMain.Server.ConnectedClients.Find(c => c.Connection == message.SenderConnection);
if (sender == null || sender.Character == null || !sender.Character.CanAccessItem(this))
{
return false;
}
}
switch (type)
{
case NetworkEventType.DropItem:
if (GameMain.Server != null)
{
Client sender = GameMain.Server.ConnectedClients.Find(c => c.Connection == message.SenderConnection);
if (sender == null || sender.Character == null || !sender.Character.CanAccessItem(this))
{
return false;
}
Drop(sender.Character, false);
if (body != null)
{