online fix
This commit is contained in:
@@ -210,7 +210,7 @@ namespace MegaKoop.Game.Networking
|
||||
EnemyDefinitionRegistry.Register(definition);
|
||||
}
|
||||
|
||||
if (!DetermineAuthority() || networkManager == null)
|
||||
if (!IsHostClient() || networkManager == null)
|
||||
{
|
||||
if (hasPendingRemoteSpawn)
|
||||
{
|
||||
@@ -241,7 +241,7 @@ namespace MegaKoop.Game.Networking
|
||||
|
||||
private void HandleInstanceDespawned(GameObject instance, EnemyDefinition definition)
|
||||
{
|
||||
if (!DetermineAuthority() || networkManager == null)
|
||||
if (!IsHostClient() || networkManager == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ namespace MegaKoop.Game.Networking
|
||||
|
||||
private void HandleEnemySpawnMessage(NetworkMessage message)
|
||||
{
|
||||
if (DetermineAuthority())
|
||||
if (IsHostClient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ namespace MegaKoop.Game.Networking
|
||||
|
||||
private void HandleEnemyDespawnMessage(NetworkMessage message)
|
||||
{
|
||||
if (DetermineAuthority())
|
||||
if (IsHostClient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -351,5 +351,11 @@ namespace MegaKoop.Game.Networking
|
||||
identity.SetNetworkId(pendingRemoteSpawn.NetworkId);
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsHostClient()
|
||||
{
|
||||
RefreshNetworkManager();
|
||||
return networkManager != null && networkManager.IsHost;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user