Unstable v0.19.1.0

This commit is contained in:
Juan Pablo Arce
2022-08-19 13:59:08 -03:00
parent 6b55adcdd9
commit 1219615d64
192 changed files with 3875 additions and 2648 deletions
@@ -175,6 +175,11 @@ namespace Barotrauma
AnimController.Frozen = false;
Enabled = true;
//if we start receiving position updates, it means the character's no longer disabled
if (DisabledByEvent && !Removed)
{
DisabledByEvent = false;
}
UInt16 networkUpdateID = 0;
if (msg.ReadBoolean())
@@ -534,6 +539,7 @@ namespace Barotrauma
Vector2 position = new Vector2(inc.ReadSingle(), inc.ReadSingle());
bool enabled = inc.ReadBoolean();
bool disabledByEvent = inc.ReadBoolean();
DebugConsole.Log("Received spawn data for " + speciesName);
@@ -569,7 +575,7 @@ namespace Barotrauma
CharacterInfo info = CharacterInfo.ClientRead(infoSpeciesName, inc);
try
{
character = Create(speciesName, position, seed, characterInfo: info, id: id, isRemotePlayer: ownerId > 0 && GameMain.Client.ID != ownerId, hasAi: hasAi);
character = Create(speciesName, position, seed, characterInfo: info, id: id, isRemotePlayer: ownerId > 0 && GameMain.Client.SessionId != ownerId, hasAi: hasAi);
}
catch (Exception e)
{
@@ -650,7 +656,7 @@ namespace Barotrauma
GameMain.GameSession.CrewManager.AddCharacter(character);
}
if (GameMain.Client.ID == ownerId)
if (GameMain.Client.SessionId == ownerId)
{
GameMain.Client.HasSpawned = true;
GameMain.Client.Character = character;
@@ -667,7 +673,14 @@ namespace Barotrauma
}
}
character.Enabled = Controlled == character || enabled;
if (disabledByEvent)
{
character.DisabledByEvent = true;
}
else
{
character.Enabled = Controlled == character || enabled;
}
return character;
}