Unstable 0.1500.0.0

This commit is contained in:
Markus Isberg
2021-08-26 21:08:21 +09:00
parent 265a2e7ab3
commit 501e02c026
245 changed files with 9775 additions and 2034 deletions
@@ -26,6 +26,9 @@ namespace Barotrauma.Networking
//any respawn items left in the shuttle are removed when the shuttle despawns
private readonly List<Item> respawnItems = new List<Item>();
//characters who spawned during the last respawn
private readonly List<Character> respawnedCharacters = new List<Character>();
public bool UsingShuttle
{
get { return RespawnShuttle != null; }
@@ -277,11 +280,17 @@ namespace Barotrauma.Networking
hull.BallastFlora?.Kill();
}
Dictionary<Character, Vector2> characterPositions = new Dictionary<Character, Vector2>();
foreach (Character c in Character.CharacterList)
{
if (c.Submarine != RespawnShuttle) { continue; }
if (!respawnedCharacters.Contains(c))
{
characterPositions.Add(c, c.WorldPosition);
continue;
}
#if CLIENT
if (Character.Controlled == c) Character.Controlled = null;
if (Character.Controlled == c) { Character.Controlled = null; }
#endif
c.Kill(CauseOfDeathType.Unknown, null, true);
c.Enabled = false;
@@ -298,6 +307,11 @@ namespace Barotrauma.Networking
RespawnShuttle.SetPosition(new Vector2(Level.Loaded.StartPosition.X, Level.Loaded.Size.Y + RespawnShuttle.Borders.Height));
RespawnShuttle.Velocity = Vector2.Zero;
foreach (var characterPosition in characterPositions)
{
characterPosition.Key.TeleportTo(characterPosition.Value);
}
}
partial void RespawnCharactersProjSpecific(Vector2? shuttlePos);