Docking port fixes again. Closes #551

- Non-saveable entities aren't removed from the linkedTo-list during saving, because that causes gaps to become unlinked with the hulls between docking ports when starting a campaign round.
- Hull rechecks are disabled on docking port gaps, because moving linked subs into place may cause the gaps to become unlinked if they're positioned in a certain way (for example in some subs the hulls between the docking ports end up inside the gap).
- Dockingports only connect the waypoints linked to their gap to each other, instead of every waypoint that happens to be inside the gap.
This commit is contained in:
Joonas Rikkonen
2018-08-29 13:38:56 +03:00
parent 48e14347a3
commit 8d83580b75
6 changed files with 39 additions and 56 deletions
@@ -135,13 +135,21 @@ namespace Barotrauma
{
base.Move(amount);
FindHulls();
if (!DisableHullRechecks) FindHulls();
}
public static void UpdateHulls()
{
foreach (Gap g in GapList)
{
for (int i = g.linkedTo.Count - 1; i >= 0; i--)
{
if (g.linkedTo[i].Removed)
{
g.linkedTo.RemoveAt(i);
}
}
if (g.DisableHullRechecks) continue;
g.FindHulls();
}