Fixed player-controlled creatures being able to do damage to themselves and RepairTools causing damage to the user regardless of the user's skills.
This commit is contained in:
@@ -910,10 +910,13 @@ namespace Barotrauma
|
||||
Vector2 attackPos =
|
||||
attackLimb.SimPosition + Vector2.Normalize(cursorPosition - attackLimb.Position) * ConvertUnits.ToSimUnits(attackLimb.attack.Range);
|
||||
|
||||
List<Body> ignoredBodies = AnimController.Limbs.Select(l => l.body.FarseerBody).ToList();
|
||||
ignoredBodies.Add(AnimController.Collider.FarseerBody);
|
||||
|
||||
var body = Submarine.PickBody(
|
||||
attackLimb.SimPosition,
|
||||
attackPos,
|
||||
AnimController.Limbs.Select(l => l.body.FarseerBody).ToList(),
|
||||
ignoredBodies,
|
||||
Physics.CollisionCharacter | Physics.CollisionWall);
|
||||
|
||||
IDamageable attackTarget = null;
|
||||
@@ -928,7 +931,7 @@ namespace Barotrauma
|
||||
body = Submarine.PickBody(
|
||||
attackLimb.SimPosition - ((Submarine)body.UserData).SimPosition,
|
||||
attackPos - ((Submarine)body.UserData).SimPosition,
|
||||
AnimController.Limbs.Select(l => l.body.FarseerBody).ToList(),
|
||||
ignoredBodies,
|
||||
Physics.CollisionWall);
|
||||
|
||||
if (body != null)
|
||||
|
||||
@@ -142,6 +142,7 @@ namespace Barotrauma.Items.Components
|
||||
if (Rand.Range(0.0f, 0.5f) > degreeOfSuccess) continue;
|
||||
ignoredBodies.Add(limb.body.FarseerBody);
|
||||
}
|
||||
ignoredBodies.Add(character.AnimController.Collider.FarseerBody);
|
||||
|
||||
IsActive = true;
|
||||
activeTimer = 0.1f;
|
||||
|
||||
Reference in New Issue
Block a user