mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
refactor: Simplify nested if
This commit is contained in:
parent
548e9dff39
commit
e69c0976a2
@ -756,14 +756,10 @@ public virtual void OnClientSceneChanged(NetworkConnection conn)
|
||||
// always become ready.
|
||||
ClientScene.Ready(conn);
|
||||
|
||||
// vis2k: replaced all this weird code with something more simple
|
||||
if (autoCreatePlayer)
|
||||
if (autoCreatePlayer && ClientScene.localPlayer == null)
|
||||
{
|
||||
// add player if existing one is null
|
||||
if (ClientScene.localPlayer == null)
|
||||
{
|
||||
ClientScene.AddPlayer();
|
||||
}
|
||||
ClientScene.AddPlayer();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
Loading…
Reference in New Issue
Block a user