From 3e7450802b22c2b777845ccc2a00c3adbec6591f Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Sun, 23 Feb 2025 19:29:15 +0000 Subject: [PATCH] fix chameleon projector ripley bug (#35070) Co-authored-by: deltanedas <@deltanedas:kde.org> --- .../Systems/SharedChameleonProjectorSystem.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs b/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs index 99737996b0..d8f0fc022f 100644 --- a/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs +++ b/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs @@ -44,6 +44,8 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem SubscribeLocalEvent(OnDisguiseInsertAttempt); SubscribeLocalEvent(OnDisguiseShutdown); + SubscribeLocalEvent(OnDisguisedInserted); + SubscribeLocalEvent(OnInteract); SubscribeLocalEvent>(OnGetVerbs); SubscribeLocalEvent(OnToggleNoRot); @@ -72,6 +74,7 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem { // stay parented to the user, not the storage args.Cancelled = true; + TryReveal(ent.Comp.User); } private void OnDisguiseShutdown(Entity ent, ref ComponentShutdown args) @@ -81,6 +84,16 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem #endregion + #region Disguised player + + private void OnDisguisedInserted(Entity ent, ref EntGotInsertedIntoContainerMessage args) + { + // prevent player going into locker/mech/etc while disguised + TryReveal((ent, ent)); + } + + #endregion + #region Projector private void OnInteract(Entity ent, ref AfterInteractEvent args) @@ -111,7 +124,7 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem public bool TryDisguise(Entity ent, EntityUid user, EntityUid target) { - if (_container.IsEntityInContainer(target)) + if (_container.IsEntityInContainer(target) || _container.IsEntityInContainer(user)) { _popup.PopupClient(Loc.GetString("chameleon-projector-inside-container"), target, user); return false; -- 2.51.2