mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
* fix: fixing PrepareToSpawnSceneObjects not added enabled objects fixes: https://github.com/MirrorNetworking/Mirror/issues/3541 Should be safe to remove this extra check complete, it is safe to add spawned object to `spawnableObjects`. For now this just changes it to NetId to ensure that the object really is unspawned and not just enabled * Update NetworkClient.cs --------- Co-authored-by: mischa <16416509+vis2k@users.noreply.github.com>
This commit is contained in:
parent
110625b102
commit
51c7162af7
@ -1193,11 +1193,12 @@ public static void PrepareToSpawnSceneObjects()
|
|||||||
foreach (NetworkIdentity identity in allIdentities)
|
foreach (NetworkIdentity identity in allIdentities)
|
||||||
{
|
{
|
||||||
// add all unspawned NetworkIdentities to spawnable objects
|
// add all unspawned NetworkIdentities to spawnable objects
|
||||||
// need to ensure it's not active yet because
|
// need to check netId to make sure object is not spawned
|
||||||
|
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3541
|
||||||
// PrepareToSpawnSceneObjects may be called multiple times in case
|
// PrepareToSpawnSceneObjects may be called multiple times in case
|
||||||
// the ObjectSpawnStarted message is received multiple times.
|
// the ObjectSpawnStarted message is received multiple times.
|
||||||
if (Utils.IsSceneObject(identity) &&
|
if (Utils.IsSceneObject(identity) &&
|
||||||
!identity.gameObject.activeSelf)
|
identity.netId == 0)
|
||||||
{
|
{
|
||||||
if (spawnableObjects.TryGetValue(identity.sceneId, out NetworkIdentity existingIdentity))
|
if (spawnableObjects.TryGetValue(identity.sceneId, out NetworkIdentity existingIdentity))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user