check for players with the current transformsync

This commit is contained in:
Mister_Nebula 2022-08-14 20:38:34 +01:00
parent 056ad56b18
commit 6b011d8acd

View File

@ -40,6 +40,14 @@ public class PlayerTransformSync : SectoredTransformSync
}
_hasRanOnStartClient = true;
if (QSBPlayerManager.PlayerList.Any(x => x.TransformSync == this))
{
// this really shouldnt happen...
DebugLog.ToConsole($"Error - A PlayerInfo already exists with TransformSync {gameObject.name}", MessageType.Error);
Destroy(this);
return;
}
var player = new PlayerInfo(this);
QSBPlayerManager.PlayerList.SafeAdd(player);
base.OnStartClient();