mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
All entities are now allocated with a TransformComponent.
Prototypes will now use existing components, like transform, when loading an entity. Previously they blindly created new ones on the entity. AddComponent now cannot overwrite a protected component, ie TransformComponent and MetaDataComponent. Entity caches these components, they cannot be changed. Regular RemoveComponent functions are now not able to remove protected components.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Robust.Shared.GameObjects.Components.Transform;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
@@ -278,6 +279,9 @@ namespace Robust.Shared.GameObjects
|
||||
// allocate the required MetaDataComponent
|
||||
_componentManager.AddComponent<MetaDataComponent>(entity);
|
||||
|
||||
// allocate the required TransformComponent
|
||||
_componentManager.AddComponent<TransformComponent>(entity);
|
||||
|
||||
Entities[entity.Uid] = entity;
|
||||
_allEntities.Add(entity);
|
||||
|
||||
@@ -322,7 +326,7 @@ namespace Robust.Shared.GameObjects
|
||||
#endregion Entity Management
|
||||
|
||||
#region ComponentEvents
|
||||
|
||||
|
||||
public void SubscribeEvent<T>(EntityEventHandler<T> eventHandler, IEntityEventSubscriber s)
|
||||
where T : EntityEventArgs
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user