private void OnHolderConInsert(Entity<StationAiHolderComponent> ent, ref EntInsertedIntoContainerMessage args)
{
+ if (_timing.ApplyingState)
+ return;
+
+ if (args.Container.ID != ent.Comp.Slot.ID)
+ return;
+
UpdateAppearance((ent.Owner, ent.Comp));
+
+ if (ent.Comp.RenameOnInsert)
+ _metadata.SetEntityName(ent.Owner, MetaData(args.Entity).EntityName);
}
private void OnHolderConRemove(Entity<StationAiHolderComponent> ent, ref EntRemovedFromContainerMessage args)
{
+ if (_timing.ApplyingState)
+ return;
+
+ if (args.Container.ID != ent.Comp.Slot.ID)
+ return;
+
UpdateAppearance((ent.Owner, ent.Comp));
+
+ if (ent.Comp.RenameOnInsert)
+ _metadata.SetEntityName(ent.Owner, Prototype(ent.Owner)?.Name ?? string.Empty);
}
private void OnHolderMapInit(Entity<StationAiHolderComponent> ent, ref MapInitEvent args)
ClearEye(ent);
ent.Comp.Remote = true;
- // Just so text and the likes works properly
- _metadata.SetEntityName(ent.Owner, MetaData(args.Entity).EntityName);
-
if (SetupEye(ent))
AttachEye(ent);
}
ent.Comp.Remote = true;
- // Reset name to whatever
- _metadata.SetEntityName(ent.Owner, Prototype(ent.Owner)?.Name ?? string.Empty);
-
// Remove eye relay
RemCompDeferred<RelayInputMoverComponent>(args.Entity);