Hacked clients can't send chat messages from other characters anymore
Also added sendername as userdata in chat messages, for now it's not used for anything but we'll probably find something where this is useful
This commit is contained in:
@@ -864,12 +864,12 @@ namespace Barotrauma
|
||||
return owner.isDead || owner.IsUnconscious || owner.Stun > 0.0f || owner.LockHands;
|
||||
}
|
||||
|
||||
if (inventory.Owner is Item)
|
||||
if (inventory.Owner is Item)
|
||||
{
|
||||
var owner = (Item)inventory.Owner;
|
||||
if (!CanAccessItem(owner))
|
||||
{
|
||||
return false;
|
||||
if (!CanAccessItem(owner))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -878,22 +878,22 @@ namespace Barotrauma
|
||||
public bool CanAccessItem(Item item)
|
||||
{
|
||||
if (item.ParentInventory != null)
|
||||
{
|
||||
{
|
||||
return CanAccessInventory(item.ParentInventory);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
float maxDist = item.PickDistance * 1.2f;
|
||||
if (maxDist <= 0.01f)
|
||||
{
|
||||
maxDist = 150.0f;
|
||||
}
|
||||
|
||||
if (Vector2.Distance(WorldPosition, item.WorldPosition) < maxDist ||
|
||||
item.IsInsideTrigger(WorldPosition))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (maxDist <= 0.01f)
|
||||
{
|
||||
maxDist = 150.0f;
|
||||
}
|
||||
|
||||
if (Vector2.Distance(WorldPosition, item.WorldPosition) < maxDist ||
|
||||
item.IsInsideTrigger(WorldPosition))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return item.GetComponent<Items.Components.Ladder>() != null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user