Fixed error message spam if a docking port is linked to another port in the same sub

This commit is contained in:
Regalis
2016-12-12 13:31:26 +02:00
parent a1d050d307
commit 5241546069
@@ -150,7 +150,8 @@ namespace Barotrauma.Items.Components
if (target.item.Submarine == item.Submarine) if (target.item.Submarine == item.Submarine)
{ {
DebugConsole.ThrowError("Error - tried to a submarine to itself"); DebugConsole.ThrowError("Error - tried to dock a submarine to itself");
dockingTarget = null;
return; return;
} }
@@ -493,6 +494,7 @@ namespace Barotrauma.Items.Components
if (!docked) if (!docked)
{ {
Dock(dockingTarget); Dock(dockingTarget);
if (dockingTarget == null) return;
} }
if (joint is DistanceJoint) if (joint is DistanceJoint)