Fixed projectiles (e.g. railgun shells) not colliding with the sub when shot from outside, fixed lightcomponents not being positioned correctly on moving items

This commit is contained in:
Regalis
2016-03-12 21:28:39 +02:00
parent d1580328ed
commit c99f94b1de
5 changed files with 23 additions and 8 deletions
@@ -92,10 +92,8 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
base.Update(deltaTime, cam);
if (item.CurrentHull != null)
{
light.Submarine = item.CurrentHull.Submarine;
}
light.Submarine = (item.CurrentHull == null) ? null : item.CurrentHull.Submarine;
if (item.Container != null)
{
@@ -105,7 +103,13 @@ namespace Barotrauma.Items.Components
if (item.body != null)
{
light.Position = item.WorldPosition;
light.Position = item.Position;
if (!item.body.Enabled)
{
light.Color = Color.Transparent;
return;
}
}
if (powerConsumption == 0.0f)