fix: respect AllowedSlots for gogo hat (#39189)

This commit is contained in:
Perry Fraser
2026-04-04 16:57:24 +02:00
committed by BarryNorfolk
parent ebefff61a2
commit 0ae4843e03
2 changed files with 15 additions and 4 deletions
@@ -30,10 +30,9 @@ public sealed class StorageVoiceControlSystem : EntitySystem
private void VoiceTriggered(Entity<StorageVoiceControlComponent> ent, ref VoiceTriggeredEvent args)
{
// Check if the component has any slot restrictions via AllowedSlots
// If it has slot restrictions, check if the item is in a slot that is allowed
if (ent.Comp.AllowedSlots != null && _inventory.TryGetContainingSlot(ent.Owner, out var itemSlot) &&
(itemSlot.SlotFlags & ent.Comp.AllowedSlots) == 0)
if (ent.Comp.AllowedSlots is { } allowedSlots
&& !_inventory.InSlotWithAnyFlags(ent.Owner, allowedSlots))
return;
// Get the storage component