Fixed SetClientCharacter & Revive
This commit is contained in:
@@ -530,6 +530,8 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
this.isDead = false;
|
||||
|
||||
health = msg.ReadRangedSingle(minHealth, maxHealth, 8);
|
||||
|
||||
bool lowOxygen = msg.ReadBoolean();
|
||||
|
||||
@@ -499,6 +499,7 @@ namespace Barotrauma
|
||||
foreach (Client c in GameMain.Server.ConnectedClients)
|
||||
{
|
||||
if (c.Character != revivedCharacter) continue;
|
||||
|
||||
//clients stop controlling the character when it dies, force control back
|
||||
GameMain.Server.SetClientCharacter(c, revivedCharacter);
|
||||
break;
|
||||
@@ -620,7 +621,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
string[] argsLeft = args.Take(separatorIndex).ToArray();
|
||||
string[] argsRight = args.Skip(separatorIndex).ToArray();
|
||||
string[] argsRight = args.Skip(separatorIndex + 1).ToArray();
|
||||
|
||||
string clientName = String.Join(" ", argsLeft);
|
||||
|
||||
|
||||
@@ -1868,13 +1868,12 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (client.Character != null) //removing control of the current character
|
||||
{
|
||||
newCharacter.IsRemotePlayer = false;
|
||||
CreateEntityEvent(client.Character, new object[] { NetEntityEvent.Type.Control, null });
|
||||
client.Character = null;
|
||||
}
|
||||
|
||||
}
|
||||
else if (client.Character != newCharacter) //taking control of a new character
|
||||
else //taking control of a new character
|
||||
{
|
||||
newCharacter.ResetNetState();
|
||||
newCharacter.LastNetworkUpdateID = client.Character.LastNetworkUpdateID;
|
||||
|
||||
Reference in New Issue
Block a user