Character freezing + Misc fixes
This commit is contained in:
@@ -62,6 +62,7 @@ namespace Barotrauma
|
||||
public override void UpdateAnim(float deltaTime)
|
||||
{
|
||||
if (character.IsDead) return;
|
||||
if (Frozen) return;
|
||||
|
||||
Vector2 colliderPos = GetLimb(LimbType.Torso).SimPosition;
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ namespace Barotrauma
|
||||
protected Hull currentHull;
|
||||
|
||||
public Limb[] Limbs;
|
||||
|
||||
private bool isFrozen = false;
|
||||
public bool Frozen = false;
|
||||
|
||||
private Dictionary<LimbType, Limb> limbDictionary;
|
||||
public RevoluteJoint[] limbJoints;
|
||||
|
||||
@@ -320,7 +324,7 @@ namespace Barotrauma
|
||||
public void AddLimb(Limb limb)
|
||||
{
|
||||
limb.body.FarseerBody.OnCollision += OnLimbCollision;
|
||||
|
||||
|
||||
Array.Resize(ref Limbs, Limbs.Length + 1);
|
||||
|
||||
Limbs[Limbs.Length-1] = limb;
|
||||
@@ -684,6 +688,27 @@ namespace Barotrauma
|
||||
{
|
||||
if (!character.Enabled) return;
|
||||
|
||||
if (Frozen)
|
||||
{
|
||||
if (!isFrozen)
|
||||
{
|
||||
foreach (Limb l in Limbs)
|
||||
{
|
||||
l.body.PhysEnabled = false;
|
||||
}
|
||||
isFrozen = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (isFrozen)
|
||||
{
|
||||
for (int i=0;i < Limbs.Length;i++)
|
||||
{
|
||||
Limbs[i].body.PhysEnabled = true;
|
||||
}
|
||||
isFrozen = false;
|
||||
}
|
||||
|
||||
UpdateNetPlayerPosition();
|
||||
|
||||
Vector2 flowForce = Vector2.Zero;
|
||||
|
||||
Reference in New Issue
Block a user