Handheld sonars only consume batteries when they're on, endworms aren't "flipped" when they turn around, every limb is checked in SubmarineBody.DisplaceCharacters (instead of just reflimb)

This commit is contained in:
Regalis
2016-04-24 20:31:26 +03:00
parent d4816c3ee9
commit c08029dea8
8 changed files with 52 additions and 32 deletions
@@ -17,7 +17,7 @@ namespace Barotrauma
private bool rotateTowardsMovement;
private bool flip;
private bool mirror, flip;
private float flipTimer;
@@ -29,7 +29,8 @@ namespace Barotrauma
waveAmplitude = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "waveamplitude", 0.0f));
waveLength = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "wavelength", 0.0f));
flip = ToolBox.GetAttributeBool(element, "flip", false);
flip = ToolBox.GetAttributeBool(element, "flip", true);
mirror = ToolBox.GetAttributeBool(element, "mirror", false);
float footRot = ToolBox.GetAttributeFloat(element,"footrotation", float.NaN);
if (float.IsNaN(footRot))
@@ -82,7 +83,7 @@ namespace Barotrauma
}
}
if (flip)
if (mirror)
{
if (!character.IsNetworkPlayer)
{
@@ -117,6 +118,8 @@ namespace Barotrauma
}
//if (stunTimer > gameTime.TotalGameTime.TotalMilliseconds) return;
if (!flip) return;
flipTimer += deltaTime;
if (TargetDir != dir)
@@ -124,7 +127,7 @@ namespace Barotrauma
if (flipTimer>1.0f || character.IsNetworkPlayer)
{
Flip();
if (flip) Mirror();
if (mirror) Mirror();
flipTimer = 0.0f;
}
}