(b522c4551) Don't assign the attackinglimb if we shouldn't be attacking. Fixes Hammerhead not falling back after hitting the sub.

This commit is contained in:
Joonas Rikkonen
2019-04-01 22:50:39 +03:00
parent e9a3577316
commit 5d6cbb5898
10 changed files with 126 additions and 109 deletions
@@ -1,7 +1,11 @@
using Barotrauma.Networking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Barotrauma.Networking;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using System;
namespace Barotrauma
{
@@ -33,12 +37,10 @@ namespace Barotrauma
if (FarseerBody.Awake)
{
body.Enabled = true;
body.LinearVelocity = NetConfig.Quantize(body.LinearVelocity, -MaxVel, MaxVel, 12);
msg.WriteRangedSingle(body.LinearVelocity.X, -MaxVel, MaxVel, 12);
msg.WriteRangedSingle(body.LinearVelocity.Y, -MaxVel, MaxVel, 12);
msg.WriteRangedSingle(MathHelper.Clamp(body.LinearVelocity.X, -MaxVel, MaxVel), -MaxVel, MaxVel, 12);
msg.WriteRangedSingle(MathHelper.Clamp(body.LinearVelocity.Y, -MaxVel, MaxVel), -MaxVel, MaxVel, 12);
if (!FarseerBody.FixedRotation)
{
body.AngularVelocity = NetConfig.Quantize(body.AngularVelocity, -MaxAngularVel, MaxAngularVel, 8);
msg.WriteRangedSingle(MathHelper.Clamp(body.AngularVelocity, -MaxAngularVel, MaxAngularVel), -MaxAngularVel, MaxAngularVel, 8);
}
}