Fixed clients not recreating docking port hulls/gaps when receiving a network event if the docking port is already locked
This commit is contained in:
@@ -243,30 +243,29 @@ namespace Barotrauma.Items.Components
|
|||||||
DebugConsole.ThrowError("Error - attempted to lock a docking port that's not connected to anything");
|
DebugConsole.ThrowError("Error - attempted to lock a docking port that's not connected to anything");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (joint is WeldJoint)
|
|
||||||
{
|
|
||||||
//DebugConsole.ThrowError("Error - attempted to lock a docking port that's already locked");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dockingDir = IsHorizontal ?
|
if (!(joint is WeldJoint))
|
||||||
Math.Sign(dockingTarget.item.WorldPosition.X - item.WorldPosition.X) :
|
{
|
||||||
Math.Sign(dockingTarget.item.WorldPosition.Y - item.WorldPosition.Y);
|
|
||||||
dockingTarget.dockingDir = -dockingDir;
|
dockingDir = IsHorizontal ?
|
||||||
|
Math.Sign(dockingTarget.item.WorldPosition.X - item.WorldPosition.X) :
|
||||||
|
Math.Sign(dockingTarget.item.WorldPosition.Y - item.WorldPosition.Y);
|
||||||
|
dockingTarget.dockingDir = -dockingDir;
|
||||||
|
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
PlaySound(ActionType.OnSecondaryUse, item.WorldPosition);
|
PlaySound(ActionType.OnSecondaryUse, item.WorldPosition);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ConnectWireBetweenPorts();
|
ConnectWireBetweenPorts();
|
||||||
|
CreateJoint(true);
|
||||||
|
|
||||||
CreateJoint(true);
|
if (GameMain.Server != null)
|
||||||
|
{
|
||||||
if (GameMain.Server != null)
|
item.CreateServerEvent(this);
|
||||||
{
|
}
|
||||||
item.CreateServerEvent(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
List<MapEntity> removedEntities = item.linkedTo.Where(e => e.Removed).ToList();
|
List<MapEntity> removedEntities = item.linkedTo.Where(e => e.Removed).ToList();
|
||||||
foreach (MapEntity removed in removedEntities) item.linkedTo.Remove(removed);
|
foreach (MapEntity removed in removedEntities) item.linkedTo.Remove(removed);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user