- host can respawn

- respawn info texts
- camera clamped to the the upper edge of the level
- fixed submarinebody being generated from all walls (and not just the ones belonging to that specific sub)
This commit is contained in:
Regalis
2016-06-23 18:23:20 +03:00
parent dc7956274c
commit 296c5a14ed
12 changed files with 204 additions and 74 deletions
+11 -8
View File
@@ -444,28 +444,31 @@ namespace Barotrauma.Items.Components
if (connection.Name=="toggle")
{
SetState(!isOpen, false);
SetState(!isOpen, false, true);
}
else if (connection.Name == "set_state")
{
SetState(signal != "0", false);
SetState(signal != "0", false, true);
}
item.NewComponentEvent(this, false, true);
}
private void SetState(bool state, bool isNetWorkMessage)
public void SetState(bool open, bool isNetworkMessage, bool sendNetworkMessage = false)
{
if (GameMain.Client != null && !isNetWorkMessage) return;
if (GameMain.Client != null && !isNetworkMessage) return;
if (isStuck || isOpen == state) return;
if (isStuck || isOpen == open) return;
PlaySound(ActionType.OnUse, item.WorldPosition);
isOpen = state;
isOpen = open;
//opening a partially stuck door makes it less stuck
if (isOpen) stuck = MathHelper.Clamp(stuck - 30.0f, 0.0f, 100.0f);
if (sendNetworkMessage)
{
item.NewComponentEvent(this, false, true);
}
}
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)