online fix

This commit is contained in:
2025-10-27 13:54:38 +01:00
parent 3ff9819d78
commit 8ea4b173a3
2 changed files with 28 additions and 9 deletions

View File

@@ -14,13 +14,10 @@ namespace MegaKoop.Game.Networking
{
// Note: Auto-increment removed in favor of deterministic ID generation
// IDs should be assigned via SetNetworkId() before or during Awake
if (assignOnAwake && networkId == 0)
if (networkId != 0)
{
Debug.LogWarning($"[NetworkIdentity] {name} has assignOnAwake=true but no ID assigned. " +
"Use DeterministicIdGenerator or manually call SetNetworkId().");
Register();
}
Register();
}
private void OnDestroy()
@@ -32,7 +29,6 @@ namespace MegaKoop.Game.Networking
{
if (networkId == 0)
{
Debug.LogWarning($"[NetworkIdentity] {name} has no network id and won't be tracked.");
return;
}