Skip to content

Commit

Permalink
fix chameleon projector bug (#1884)
Browse files Browse the repository at this point in the history
Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Sep 23, 2024
1 parent 92546f2 commit 88a5080
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Content.Shared.Polymorph;
using Content.Shared.Polymorph.Components;
using Content.Shared.Popups;
using Content.Shared.Storage.Components;
using Robust.Shared.Containers;
using Robust.Shared.Network;
using Robust.Shared.Physics.Components;
Expand Down Expand Up @@ -43,6 +44,7 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<ChameleonDisguiseComponent, GotEquippedHandEvent>(OnDisguiseEquippedHand);
SubscribeLocalEvent<ChameleonDisguiseComponent, InsertIntoEntityStorageAttemptEvent>(OnDisguiseInsertAttempt);
SubscribeLocalEvent<ChameleonDisguiseComponent, ComponentShutdown>(OnDisguiseShutdown);

SubscribeLocalEvent<ChameleonDisguisedComponent, DamageChangedEvent>(OnDamageChanged);
Expand All @@ -63,6 +65,12 @@ private void OnDisguiseEquippedHand(Entity<ChameleonDisguiseComponent> ent, ref
args.Handled = true;
}

private void OnDisguiseInsertAttempt(Entity<ChameleonDisguiseComponent> ent, ref InsertIntoEntityStorageAttemptEvent args)
{
// stay parented to the user, not the storage
args.Cancelled = true;
}

private void OnDisguiseShutdown(Entity<ChameleonDisguiseComponent> ent, ref ComponentShutdown args)
{
_actions.RemoveProvidedActions(ent.Comp.User, ent.Comp.Projector);
Expand Down

0 comments on commit 88a5080

Please sign in to comment.