Fixes
It compiles now, but it's probably really broken.
This commit is contained in:
@@ -309,7 +309,6 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (!PlayerInput.LeftButtonHeld())
|
||||
{
|
||||
panel.Item.NewComponentEvent(panel, true, true);
|
||||
//draggingConnected.Drop(Character);
|
||||
draggingConnected = null;
|
||||
}
|
||||
|
||||
@@ -75,43 +75,19 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else if (connection.Name == "toggle")
|
||||
{
|
||||
SetState(!IsOn,false,true);
|
||||
SetState(!IsOn);
|
||||
}
|
||||
else if (connection.Name == "set_state")
|
||||
{
|
||||
SetState(signal != "0", false, true);
|
||||
SetState(signal != "0");
|
||||
}
|
||||
}
|
||||
|
||||
public void SetState(bool on, bool isNetworkMessage, bool sendNetworkMessage = false)
|
||||
public void SetState(bool on)
|
||||
{
|
||||
if (GameMain.Client != null && !isNetworkMessage) return;
|
||||
//if (GameMain.Client != null && !isNetworkMessage) return;
|
||||
|
||||
IsOn = on;
|
||||
if (sendNetworkMessage)
|
||||
{
|
||||
item.NewComponentEvent(this, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
|
||||
{
|
||||
message.Write(IsOn);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message, float sendingTime)
|
||||
{
|
||||
if (sendingTime < lastReceivedMessage) return;
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lastReceivedMessage = sendingTime;
|
||||
|
||||
SetState(message.ReadBoolean(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,9 +160,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
|
||||
Drawable = Nodes.Any();
|
||||
|
||||
if (!loading) Item.NewComponentEvent(this, true, true);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -255,8 +253,6 @@ namespace Barotrauma.Items.Components
|
||||
if (Nodes.Count > 1)
|
||||
{
|
||||
Nodes.RemoveAt(Nodes.Count - 1);
|
||||
|
||||
item.NewComponentEvent(this, true, true);
|
||||
}
|
||||
|
||||
Drawable = Nodes.Any();
|
||||
|
||||
Reference in New Issue
Block a user