(61f67c194) Fix the raycast and angle checks. use the weapon position instead of the character position.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:56:16 +03:00
parent 2de6c7e47d
commit fe5f386358
29 changed files with 496 additions and 433 deletions
@@ -491,6 +491,18 @@ namespace Barotrauma
}
}
foreach (MapEntity e in MapEntity.mapEntityList)
{
if (Vector2.Distance(e.Position, HiddenSubPosition) > 20000)
{
//move disabled items (wires, items inside containers) inside the sub
if (e is Item item && item.body != null && !item.body.Enabled)
{
item.SetTransform(ConvertUnits.ToSimUnits(HiddenSubPosition), 0.0f);
}
}
}
foreach (MapEntity e in MapEntity.mapEntityList)
{
if (Vector2.Distance(e.Position, HiddenSubPosition) > 20000)