(14f26adfa) Take the position of a sub's docking port into account when determining where to place outposts. Humpback's docking port for example is 600 units to the right from the sub's centerpoint, which prevented it from docking in some levels because the left side of the sub hit the wall at the left side of the outpost. Closes #1028

This commit is contained in:
Joonas Rikkonen
2019-03-25 19:49:48 +02:00
parent 26594e2c6c
commit 19d5ed5d66
12 changed files with 131 additions and 145 deletions
@@ -520,10 +520,9 @@ 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 wall && structureBody != null &&
(structureBody.UserData is Structure || (structureBody.UserData is Submarine sub && sub == wall.Submarine)))
else if (damageTarget is Structure && structureBody?.UserData is Structure)
{
// If the attack is aimed to a structure (wall) and hits a structure or the sub, it's successful
// If the attack is aimed to a structure and hits a structure, it's successful
wasHit = true;
}
else