refactor: Simplify nested if

This commit is contained in:
Paul Pacheco 2019-04-15 06:30:41 -05:00
parent 548e9dff39
commit e69c0976a2

View File

@ -756,16 +756,12 @@ 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();
}
}
}
#endregion
#region Start & Stop callbacks