Merge branch 'master' into moStuff
This commit is contained in:
@@ -78,7 +78,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
//re-enable collider
|
||||
if (!Collider.FarseerBody.Enabled)
|
||||
if (!Collider.Enabled)
|
||||
{
|
||||
var lowestLimb = FindLowestLimb();
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Barotrauma
|
||||
Math.Max(lowestLimb.SimPosition.Y + (Collider.radius + Collider.height / 2), Collider.SimPosition.Y)),
|
||||
0.0f);
|
||||
|
||||
Collider.FarseerBody.Enabled = true;
|
||||
Collider.Enabled = true;
|
||||
}
|
||||
|
||||
ResetPullJoints();
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Barotrauma
|
||||
|
||||
|
||||
//re-enable collider
|
||||
if (!Collider.FarseerBody.Enabled)
|
||||
if (!Collider.Enabled)
|
||||
{
|
||||
var lowestLimb = FindLowestLimb();
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Barotrauma
|
||||
Collider.Rotation);
|
||||
|
||||
Collider.FarseerBody.ResetDynamics();
|
||||
Collider.FarseerBody.Enabled = true;
|
||||
Collider.Enabled = true;
|
||||
}
|
||||
|
||||
if (swimming)
|
||||
@@ -1034,7 +1034,8 @@ namespace Barotrauma
|
||||
{
|
||||
Limb targetLimb = target.AnimController.GetLimb(GrabLimb);
|
||||
|
||||
if (targetLimb == null || targetLimb.IsSevered)
|
||||
//grab hands if GrabLimb is not specified (or torso if the character has no hands)
|
||||
if (GrabLimb == LimbType.None || targetLimb.IsSevered)
|
||||
{
|
||||
targetLimb = target.AnimController.GetLimb(LimbType.Torso);
|
||||
if (i == 0)
|
||||
|
||||
@@ -527,7 +527,7 @@ namespace Barotrauma
|
||||
|
||||
public void SeverLimbJoint(LimbJoint limbJoint)
|
||||
{
|
||||
if (!limbJoint.CanBeSevered)
|
||||
if (!limbJoint.CanBeSevered || limbJoint.IsSevered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -541,12 +541,29 @@ namespace Barotrauma
|
||||
GetConnectedLimbs(connectedLimbs, checkedJoints, MainLimb);
|
||||
foreach (Limb limb in Limbs)
|
||||
{
|
||||
if (!connectedLimbs.Contains(limb))
|
||||
if (connectedLimbs.Contains(limb)) continue;
|
||||
|
||||
limb.IsSevered = true;
|
||||
}
|
||||
|
||||
#if CLIENT
|
||||
if (character.UseBloodParticles)
|
||||
{
|
||||
foreach (Limb limb in new Limb[] { limbJoint.LimbA, limbJoint.LimbB })
|
||||
{
|
||||
limb.IsSevered = true;
|
||||
for (int i = 0; i < MathHelper.Clamp(limb.Mass * 2.0f, 1.0f, 50.0f); i++)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("gib", limb.WorldPosition, Rand.Range(0.0f, MathHelper.TwoPi), Rand.Range(200.0f, 700.0f), character.CurrentHull);
|
||||
}
|
||||
|
||||
for (int i = 0; i < MathHelper.Clamp(limb.Mass * 2.0f, 1.0f, 10.0f); i++)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("heavygib", limb.WorldPosition, Rand.Range(0.0f, MathHelper.TwoPi), Rand.Range(50.0f, 250.0f), character.CurrentHull);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
GameMain.Server.CreateEntityEvent(character, new object[] { NetEntityEvent.Type.Status });
|
||||
@@ -1469,5 +1486,12 @@ namespace Barotrauma
|
||||
list.Remove(this);
|
||||
}
|
||||
|
||||
public static void RemoveAll()
|
||||
{
|
||||
for (int i = list.Count - 1; i >= 0; i--)
|
||||
{
|
||||
list[i].Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user