mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
commit
0f0fbc550e
@ -51,22 +51,21 @@ namespace QSB.Player
|
|||||||
}
|
}
|
||||||
|
|
||||||
var player = PlayerList.FirstOrDefault(x => x.PlayerId == id);
|
var player = PlayerList.FirstOrDefault(x => x.PlayerId == id);
|
||||||
if (player != null)
|
if (player == null)
|
||||||
{
|
{
|
||||||
return player;
|
DebugLog.ToConsole($"Error - Player with id {id} does not exist! Stacktrace : {Environment.StackTrace}", MessageType.Error);
|
||||||
}
|
|
||||||
|
|
||||||
if (!QSBCore.IsInMultiplayer)
|
|
||||||
{
|
|
||||||
DebugLog.ToConsole($"Error - Tried to create player id:{id} when not in multiplayer! Stacktrace : {Environment.StackTrace}", MessageType.Error);
|
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddPlayer(uint id)
|
||||||
|
{
|
||||||
DebugLog.DebugWrite($"Create Player : id<{id}>", MessageType.Info);
|
DebugLog.DebugWrite($"Create Player : id<{id}>", MessageType.Info);
|
||||||
player = new PlayerInfo(id);
|
var player = new PlayerInfo(id);
|
||||||
PlayerList.Add(player);
|
PlayerList.Add(player);
|
||||||
OnAddPlayer?.Invoke(id);
|
OnAddPlayer?.Invoke(id);
|
||||||
return player;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RemovePlayer(uint id)
|
public static void RemovePlayer(uint id)
|
||||||
|
@ -50,6 +50,7 @@ namespace QSB.Player.TransformSync
|
|||||||
public override void Start()
|
public override void Start()
|
||||||
{
|
{
|
||||||
base.Start();
|
base.Start();
|
||||||
|
QSBPlayerManager.AddPlayer(PlayerId);
|
||||||
Player.TransformSync = this;
|
Player.TransformSync = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user