feat: allow control replication via code, fix null owner on OnEntityCreated

This commit is contained in:
2023-10-16 23:37:35 +03:00
parent e7dd693147
commit 893c73512a
9 changed files with 56 additions and 39 deletions
@@ -57,11 +57,11 @@ internal class EntityCreateHandler : IHandler
var hasAuthority = _playerCache.Local.Id == player.Id;
var entity = _entityCache.TryGetEntity(attachId, entityType, 0, entityId, hasAuthority, out var hasCreated);
entity.AttachPayload(payload);
entity.Prepare(_client, entityId, entityType, hasAuthority, player, payload);
if (hasCreated)
_entityListener.OnEntityCreated(entity);
entity.Attach(_client, entityId, entityType, hasAuthority, player);
entity.Attach();
}
}