(b2df6e88c) Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev

This commit is contained in:
Joonas Rikkonen
2019-04-01 22:50:25 +03:00
parent d511ecd4e3
commit e9a3577316
3 changed files with 67 additions and 28 deletions
@@ -726,7 +726,8 @@ namespace Barotrauma
if (!canAttack && !IsCoolDownRunning)
{
// If not, reset the attacking limb, if the cooldown is not running
AttackingLimb = null;
// Don't use the property, because we don't want cancel reversing, if we are reversing.
_attackingLimb = null;
}
}
@@ -797,7 +798,6 @@ namespace Barotrauma
{
UpdateLimbAttack(deltaTime, AttackingLimb, attackSimPos, distance);
}
return false;
}
private bool SteerThroughGap(Structure wall, WallSection section, Vector2 targetWorldPos, float deltaTime)
@@ -1169,15 +1169,15 @@ namespace Barotrauma
else if (target.Entity is Structure s)
{
targetingTag = "wall";
if (!s.HasBody)
{
// Ignore structures that doesn't have a body (not walls)
continue;
}
// Ignore walls when inside.
valueModifier = character.CurrentHull == null ? 1 : 0;
if (aggressiveBoarding)
{
// Ignore walls when inside.
valueModifier = character.CurrentHull == null ? 2 : 0;
if (valueModifier > 0)
{
// Ignore structures that doesn't have a body (not walls)
valueModifier *= s.HasBody ? 1 : 0;
}
for (int i = 0; i < s.Sections.Length; i++)
{
var section = s.Sections[i];
@@ -1194,6 +1194,23 @@ namespace Barotrauma
}
}
}
else
{
// Ignore disabled walls
bool isDisabled = true;
for (int i = 0; i < s.Sections.Length; i++)
{
if (!s.SectionBodyDisabled(i))
{
isDisabled = false;
break;
}
}
if (isDisabled)
{
valueModifier = 0;
}
}
}
else
{
@@ -1216,25 +1233,7 @@ namespace Barotrauma
valueModifier = isOutdoor ? 1 : 0;
valueModifier *= isOpen ? 5 : 1;
}
}
}
else
{
targetingTag = "room";
}
if (door != null)
{
// If there's not a more specific tag for the door
if (string.IsNullOrEmpty(targetingTag) || targetingTag == "room")
{
targetingTag = "door";
}
bool isOutdoor = door.LinkedGap?.FlowTargetHull != null && !door.LinkedGap.IsRoomToRoom;
bool isOpen = door.IsOpen || door.Item.Condition <= 0.0f;
//increase priority if the character is outside and an aggressive boarder, and the door is from outside to inside
if (aggressiveBoarding)
{
if (character.CurrentHull == null)
for (int i = 0; i < s.Sections.Length; i++)
{
valueModifier = isOutdoor ? 0 : 1;
valueModifier *= isOpen ? 0 : 1;