Skip to content

Commit

Permalink
Don't force LWE requirement.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPurple6411 committed Jan 14, 2024
1 parent e7e7866 commit 7cd473a
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Nautilus/MonoBehaviours/EntitySpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,11 @@ IEnumerator SpawnAsync()
yield break;
}

LargeWorldEntity lwe = prefab.GetComponent<LargeWorldEntity>();

if (lwe == null)
{
InternalLogger.Error($"no LargeWorldEntity found for {stringToLog}; process for Coordinated Spawn canceled.");
Destroy(gameObject);
yield break;
}

GameObject obj = UWE.Utils.InstantiateDeactivated(prefab, spawnInfo.SpawnPosition, spawnInfo.Rotation, spawnInfo.ActualScale);
lwe = obj.GetComponent<LargeWorldEntity>();
var lwe = obj.GetComponent<LargeWorldEntity>();

yield return new WaitUntil(()=> LargeWorld.main?.streamer?.cellManager?.RegisterEntity(lwe)?? false); // then we register the entity to the cell manager
if (lwe != null)
yield return new WaitUntil(() => LargeWorld.main?.streamer?.cellManager?.RegisterEntity(lwe) ?? false);

obj.SetActive(true);
Destroy(gameObject);
Expand Down

0 comments on commit 7cd473a

Please sign in to comment.