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:
@@ -305,6 +305,7 @@
|
|||||||
<requireditem name="Screwdriver,Wire" type="Equipped"/>
|
<requireditem name="Screwdriver,Wire" type="Equipped"/>
|
||||||
<input name="toggle"/>
|
<input name="toggle"/>
|
||||||
<input name="set_state"/>
|
<input name="set_state"/>
|
||||||
|
<input name="set_color"/>
|
||||||
</ConnectionPanel>
|
</ConnectionPanel>
|
||||||
|
|
||||||
</Item>
|
</Item>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-3.0"/>
|
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-3.0"/>
|
||||||
|
|
||||||
<LightComponent color="1.0,0.9,0.7,1.0" Flicker="0.5">
|
<LightComponent LightColor="1.0,0.9,0.7,1.0" Flicker="0.5">
|
||||||
<sprite texture="Content/Items/Electricity/lightsprite.png" origin="0.5,0.5"/>
|
<sprite texture="Content/Items/Electricity/lightsprite.png" origin="0.5,0.5"/>
|
||||||
</LightComponent>
|
</LightComponent>
|
||||||
</RepairTool>
|
</RepairTool>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-3.0"/>
|
<StatusEffect type="OnFailure" target="Contained" targetnames="Welding Fuel Tank,Oxygen Tank" Condition="-3.0"/>
|
||||||
|
|
||||||
<LightComponent color="0.1,0.8,1.0,1.0" Flicker="0.5">
|
<LightComponent LightColor="0.8,0.7,1.0,1.0" Flicker="0.5">
|
||||||
<sprite texture="Content/Items/Electricity/lightsprite.png" origin="0.5,0.5"/>
|
<sprite texture="Content/Items/Electricity/lightsprite.png" origin="0.5,0.5"/>
|
||||||
</LightComponent>
|
</LightComponent>
|
||||||
</RepairTool>
|
</RepairTool>
|
||||||
|
|||||||
@@ -149,6 +149,16 @@ namespace Barotrauma.Items.Components
|
|||||||
AttackResult attackResult = new AttackResult(0.0f, 0.0f);
|
AttackResult attackResult = new AttackResult(0.0f, 0.0f);
|
||||||
if (attack != null)
|
if (attack != null)
|
||||||
{
|
{
|
||||||
|
var submarine = f2.Body.UserData as Submarine;
|
||||||
|
if (submarine != null)
|
||||||
|
{
|
||||||
|
item.Move(-submarine.Position);
|
||||||
|
item.Submarine = submarine;
|
||||||
|
item.body.Submarine = submarine;
|
||||||
|
item.FindHull();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Limb limb;
|
Limb limb;
|
||||||
Structure structure;
|
Structure structure;
|
||||||
if ((limb = (f2.Body.UserData as Limb)) != null)
|
if ((limb = (f2.Body.UserData as Limb)) != null)
|
||||||
|
|||||||
@@ -92,10 +92,8 @@ namespace Barotrauma.Items.Components
|
|||||||
public override void Update(float deltaTime, Camera cam)
|
public override void Update(float deltaTime, Camera cam)
|
||||||
{
|
{
|
||||||
base.Update(deltaTime, cam);
|
base.Update(deltaTime, cam);
|
||||||
if (item.CurrentHull != null)
|
|
||||||
{
|
light.Submarine = (item.CurrentHull == null) ? null : item.CurrentHull.Submarine;
|
||||||
light.Submarine = item.CurrentHull.Submarine;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Container != null)
|
if (item.Container != null)
|
||||||
{
|
{
|
||||||
@@ -105,7 +103,13 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
if (item.body != null)
|
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)
|
if (powerConsumption == 0.0f)
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
body.BodyType = BodyType.Dynamic;
|
body.BodyType = BodyType.Dynamic;
|
||||||
body.CollisionCategories = Physics.CollisionMisc | Physics.CollisionWall;
|
body.CollisionCategories = Physics.CollisionMisc | Physics.CollisionWall;
|
||||||
body.CollidesWith = Physics.CollisionLevel | Physics.CollisionCharacter;
|
body.CollidesWith = Physics.CollisionLevel | Physics.CollisionCharacter | Physics.CollisionProjectile;
|
||||||
body.Restitution = Restitution;
|
body.Restitution = Restitution;
|
||||||
body.Friction = Friction;
|
body.Friction = Friction;
|
||||||
body.FixedRotation = true;
|
body.FixedRotation = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user