AutoCompState + ItemToggle fixes (#23422)
* AutoCompState + ItemToggle fixes Fix a lot of the comp states that are never actually networked and also cleaned up ItemToggle events a bunch. ItemToggle will still need some future work for lights and sounds. * Also catch these
This commit is contained in:
@@ -23,7 +23,7 @@ public sealed class ContainerHeldSystem : EntitySystem
|
||||
|
||||
private void OnContainerModified(EntityUid uid, ContainerHeldComponent comp, ContainerModifiedMessage args)
|
||||
{
|
||||
if (!(TryComp<StorageComponent>(uid, out var storage)
|
||||
if (!(HasComp<StorageComponent>(uid)
|
||||
&& TryComp<AppearanceComponent>(uid, out var appearance)
|
||||
&& TryComp<ItemComponent>(uid, out var item)))
|
||||
{
|
||||
@@ -31,12 +31,12 @@ public sealed class ContainerHeldSystem : EntitySystem
|
||||
}
|
||||
if (_storage.GetCumulativeItemAreas(uid) >= comp.Threshold)
|
||||
{
|
||||
_item.SetHeldPrefix(uid, "full", item);
|
||||
_item.SetHeldPrefix(uid, "full", component: item);
|
||||
_appearance.SetData(uid, ToggleVisuals.Toggled, true, appearance);
|
||||
}
|
||||
else
|
||||
{
|
||||
_item.SetHeldPrefix(uid, "empty", item);
|
||||
_item.SetHeldPrefix(uid, "empty", component: item);
|
||||
_appearance.SetData(uid, ToggleVisuals.Toggled, false, appearance);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user