(afed4e8fa) Check that the container is in the same hull than the character before allowing to contain items. Might solve the floating diving suit mentioned in #1362.
This commit is contained in:
+1
-3
@@ -113,14 +113,12 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Vector2.Distance(character.Position, container.Item.Position) > container.Item.InteractDistance
|
if (container.Item.CurrentHull != character.CurrentHull || (Vector2.Distance(character.Position, container.Item.Position) > container.Item.InteractDistance && !container.Item.IsInsideTrigger(character.WorldPosition)))
|
||||||
&& !container.Item.IsInsideTrigger(character.WorldPosition))
|
|
||||||
{
|
{
|
||||||
goToObjective = new AIObjectiveGoTo(container.Item, character);
|
goToObjective = new AIObjectiveGoTo(container.Item, character);
|
||||||
AddSubObjective(goToObjective);
|
AddSubObjective(goToObjective);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
container.Combine(itemToContain);
|
container.Combine(itemToContain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user