(084340338) Add an aim timer before the weapon can be used. Fix a null reference exception.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:54:33 +03:00
parent a2e40ed3eb
commit e9664d3639
28 changed files with 495 additions and 419 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)