Fixed access to items without PickDistance
The ladder check is a horrible hack, but if you're horribly desynced then trying to interact with one will just kill you :)
This commit is contained in:
@@ -868,7 +868,7 @@ namespace Barotrauma
|
|||||||
if (inventory.Owner is Item)
|
if (inventory.Owner is Item)
|
||||||
{
|
{
|
||||||
var owner = (Item)inventory.Owner;
|
var owner = (Item)inventory.Owner;
|
||||||
if (Vector2.Distance(SimPosition, owner.SimPosition) > owner.PickDistance * 0.01f)
|
if (!CanAccessItem(owner))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -887,7 +887,12 @@ namespace Barotrauma
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Vector2.Distance(SimPosition, item.SimPosition) > item.PickDistance * 0.01f)
|
float maxDist = item.PickDistance;
|
||||||
|
if (maxDist<=0.01f)
|
||||||
|
{
|
||||||
|
maxDist = 150.0f;
|
||||||
|
}
|
||||||
|
if (Vector2.Distance(SimPosition, item.SimPosition) > maxDist * 0.01f && item.ConfigFile.ToLower().IndexOf("ladder.xml")<0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user