Add network error log for missing network object when accessing ownership

#1066
This commit is contained in:
Wojtek Figat
2023-05-16 13:08:25 +02:00
parent 3fa9f9e9cf
commit 64f3f1e9bc

View File

@@ -878,9 +878,16 @@ uint32 NetworkReplicator::GetObjectOwnerClientId(const ScriptingObject* obj)
{
if (item.HasOwnership)
id = item.OwnerClientId;
#if USE_NETWORK_REPLICATOR_LOG
return id;
#else
break;
#endif
}
}
#if USE_NETWORK_REPLICATOR_LOG
NETWORK_REPLICATOR_LOG(Error, "[NetworkReplicator] Failed to get ownership of unregistered network object {} ({})", obj->GetID(), obj->GetType().ToString());
#endif
}
}
return id;
@@ -903,9 +910,16 @@ NetworkObjectRole NetworkReplicator::GetObjectRole(const ScriptingObject* obj)
{
if (item.HasOwnership)
role = item.Role;
#if USE_NETWORK_REPLICATOR_LOG
return role;
#else
break;
#endif
}
}
#if USE_NETWORK_REPLICATOR_LOG
NETWORK_REPLICATOR_LOG(Error, "[NetworkReplicator] Failed to get ownership of unregistered network object {} ({})", obj->GetID(), obj->GetType().ToString());
#endif
}
}
return role;