Fix smoking visuals, but properly this time. (#6051)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -121,7 +121,7 @@ namespace Content.Shared.Item
|
||||
private void OnEquippedPrefixChange()
|
||||
{
|
||||
if (Owner.TryGetContainer(out var container))
|
||||
EntitySystem.Get<SharedHandsSystem>().UpdateHandVisuals(container.Owner);
|
||||
_entMan.EventBus.RaiseLocalEvent(container.Owner, new ItemPrefixChangeEvent(Owner, container.ID));
|
||||
}
|
||||
|
||||
public void RemovedFromSlot()
|
||||
@@ -154,6 +154,23 @@ namespace Content.Shared.Item
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised when an item's EquippedPrefix is changed. The event is directed at the entity that contains this item, so
|
||||
/// that it can properly update its sprite/GUI.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public class ItemPrefixChangeEvent : EntityEventArgs
|
||||
{
|
||||
public readonly EntityUid Item;
|
||||
public readonly string ContainerId;
|
||||
|
||||
public ItemPrefixChangeEvent(EntityUid item, string containerId)
|
||||
{
|
||||
Item = item;
|
||||
ContainerId = containerId;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reference sizes for common containers and items.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user