v0.13.0.11

This commit is contained in:
Joonas Rikkonen
2021-04-22 17:33:08 +03:00
parent 0697d7fc64
commit 8bb31f2893
391 changed files with 17271 additions and 5949 deletions
@@ -70,17 +70,15 @@ namespace Barotrauma.Items.Components
public override void ClientRead(ServerNetObject type, IReadMessage msg, float sendingTime)
{
base.ClientRead(type, msg, sendingTime);
bool readAttachData = msg.ReadBoolean();
if (!readAttachData) { return; }
bool shouldBeAttached = msg.ReadBoolean();
Vector2 simPosition = new Vector2(msg.ReadSingle(), msg.ReadSingle());
UInt16 submarineID = msg.ReadUInt16();
Submarine sub = Entity.FindEntityByID(submarineID) as Submarine;
if (!attachable)
{
DebugConsole.ThrowError("Received an attachment event for an item that's not attachable.");
return;
}
if (shouldBeAttached)
{
if (!attached)
@@ -96,7 +94,6 @@ namespace Barotrauma.Items.Components
if (attached)
{
DropConnectedWires(null);
if (body != null)
{
item.body = body;
@@ -106,6 +103,11 @@ namespace Barotrauma.Items.Components
DeattachFromWall();
}
else
{
item.SetTransform(simPosition, 0.0f);
item.Submarine = sub;
}
}
}
}