Content ecs containers (#22484)
This commit is contained in:
@@ -137,7 +137,7 @@ public sealed class LightReplacerSystem : EntitySystem
|
||||
if (bulb.Valid) // FirstOrDefault can return default/invalid uid.
|
||||
{
|
||||
// try to remove it
|
||||
var hasRemoved = replacer.InsertedBulbs.Remove(bulb);
|
||||
var hasRemoved = _container.Remove(bulb, replacer.InsertedBulbs);
|
||||
if (!hasRemoved)
|
||||
return false;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public sealed class LightReplacerSystem : EntitySystem
|
||||
}
|
||||
|
||||
// try insert light and show message
|
||||
var hasInsert = replacer.InsertedBulbs.Insert(bulbUid);
|
||||
var hasInsert = _container.Insert(bulbUid, replacer.InsertedBulbs);
|
||||
if (hasInsert && showTooltip && userUid != null)
|
||||
{
|
||||
var msg = Loc.GetString("comp-light-replacer-insert-light",
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (light.HasLampOnSpawn != null)
|
||||
{
|
||||
var entity = EntityManager.SpawnEntity(light.HasLampOnSpawn, EntityManager.GetComponent<TransformComponent>(uid).Coordinates);
|
||||
light.LightBulbContainer.Insert(entity);
|
||||
_containerSystem.Insert(entity, light.LightBulbContainer);
|
||||
}
|
||||
// need this to update visualizers
|
||||
UpdateLight(uid, light);
|
||||
@@ -182,7 +182,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
return false;
|
||||
|
||||
// try to insert bulb in container
|
||||
if (!light.LightBulbContainer.Insert(bulbUid))
|
||||
if (!_containerSystem.Insert(bulbUid, light.LightBulbContainer))
|
||||
return false;
|
||||
|
||||
UpdateLight(uid, light);
|
||||
@@ -203,7 +203,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
return null;
|
||||
|
||||
// try to remove bulb from container
|
||||
if (!light.LightBulbContainer.Remove(bulb))
|
||||
if (!_containerSystem.Remove(bulb, light.LightBulbContainer))
|
||||
return null;
|
||||
|
||||
// try to place bulb in hands
|
||||
|
||||
Reference in New Issue
Block a user