(ae643deeb) Added alive checks to a couple of diving gear status effects (don't consume tanks when dead)
This commit is contained in:
@@ -520,14 +520,15 @@ namespace Barotrauma
|
||||
// Ignore blocking on items, because it causes cases where a Mudraptor cannot hit the hatch, for example.
|
||||
wasHit = true;
|
||||
}
|
||||
else if (damageTarget is Structure && structureBody?.UserData is Structure)
|
||||
else if (damageTarget is Structure wall && structureBody != null &&
|
||||
(structureBody.UserData is Structure || (structureBody.UserData is Submarine sub && sub == wall.Submarine)))
|
||||
{
|
||||
// If the attack is aimed to a structure and hits a structure, it's successful
|
||||
// If the attack is aimed to a structure (wall) and hits a structure or the sub, it's successful
|
||||
wasHit = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the attack is aimed to a character but hits a structure, the hit is blocked.
|
||||
// If there is nothing between, the hit is successful
|
||||
wasHit = structureBody == null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user