]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix chameleon projector ripley bug (#35070)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Sun, 23 Feb 2025 19:29:15 +0000 (19:29 +0000)
committerGitHub <noreply@github.com>
Sun, 23 Feb 2025 19:29:15 +0000 (20:29 +0100)
Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs

index 99737996b0873de7e8399016847f5a61ffb108d1..d8f0fc022f1d3ff9bb4caa94e4a0734eda2c2674 100644 (file)
@@ -44,6 +44,8 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
         SubscribeLocalEvent<ChameleonDisguiseComponent, InsertIntoEntityStorageAttemptEvent>(OnDisguiseInsertAttempt);
         SubscribeLocalEvent<ChameleonDisguiseComponent, ComponentShutdown>(OnDisguiseShutdown);
 
+        SubscribeLocalEvent<ChameleonDisguisedComponent, EntGotInsertedIntoContainerMessage>(OnDisguisedInserted);
+
         SubscribeLocalEvent<ChameleonProjectorComponent, AfterInteractEvent>(OnInteract);
         SubscribeLocalEvent<ChameleonProjectorComponent, GetVerbsEvent<UtilityVerb>>(OnGetVerbs);
         SubscribeLocalEvent<ChameleonProjectorComponent, DisguiseToggleNoRotEvent>(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<ChameleonDisguiseComponent> ent, ref ComponentShutdown args)
@@ -81,6 +84,16 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
 
     #endregion
 
+    #region Disguised player
+
+    private void OnDisguisedInserted(Entity<ChameleonDisguisedComponent> ent, ref EntGotInsertedIntoContainerMessage args)
+    {
+        // prevent player going into locker/mech/etc while disguised
+        TryReveal((ent, ent));
+    }
+
+    #endregion
+
     #region Projector
 
     private void OnInteract(Entity<ChameleonProjectorComponent> ent, ref AfterInteractEvent args)
@@ -111,7 +124,7 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
 
     public bool TryDisguise(Entity<ChameleonProjectorComponent> 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;