mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Delete some entity init code (#3947)
This commit is contained in:
@@ -125,21 +125,6 @@ namespace Robust.Shared.GameObjects
|
||||
var comps = compsFixed.AsSpan;
|
||||
CopyComponentsInto(ref comps, uid);
|
||||
|
||||
// TODO: please for the love of god remove these initialization order hacks.
|
||||
|
||||
// Init transform first, we always have it.
|
||||
var transform = GetComponent<TransformComponent>(uid);
|
||||
if (transform.LifeStage < ComponentLifeStage.Initialized)
|
||||
transform.LifeInitialize(this, CompIdx.Index<TransformComponent>());
|
||||
|
||||
// Init physics second if it exists.
|
||||
if (TryGetComponent<PhysicsComponent>(uid, out var phys)
|
||||
&& phys.LifeStage < ComponentLifeStage.Initialized)
|
||||
{
|
||||
phys.LifeInitialize(this, CompIdx.Index<PhysicsComponent>());
|
||||
}
|
||||
|
||||
// Do rest of components.
|
||||
foreach (var comp in comps)
|
||||
{
|
||||
if (comp is { LifeStage: < ComponentLifeStage.Initialized })
|
||||
|
||||
Reference in New Issue
Block a user