Clients ignore messages about attaching an item to a wall if the item is not attachable, and don't drop the the items before attaching (because it disconnects all connected wires). The spamevents debug command didn't work correctly because of this, and I'd imagine that the latter could have caused wires to drop from some attached items when joining mid-round.

This commit is contained in:
Joonas Rikkonen
2017-08-03 19:29:27 +03:00
parent 3b6630562c
commit 264015346d

View File

@@ -360,9 +360,19 @@ namespace Barotrauma.Items.Components
public void ClientRead(ServerNetObject type, NetBuffer msg, float sendingTime)
{
bool isAttached = msg.ReadBoolean();
if (!attachable)
{
DebugConsole.ThrowError("Received an attachment event for an item that's not attachable.");
return;
}
if (isAttached)
{
item.Drop();
if (item.ParentInventory != null)
{
item.ParentInventory.RemoveItem(item);
}
AttachToWall();
}
else