]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixed GluedComponent interactions with metamorphic glasses (#24943)
authorKrunklehorn <42424291+Krunklehorn@users.noreply.github.com>
Wed, 7 Feb 2024 23:43:44 +0000 (18:43 -0500)
committerGitHub <noreply@github.com>
Wed, 7 Feb 2024 23:43:44 +0000 (16:43 -0700)
* Only rename if name matches reconstructed

* Rearranged query

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Okay

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Content.Server/Glue/GlueSystem.cs

index 9409a423c44e0fbbceb3e3b87bc0c4691ecbe97d..6bb6aca3ad215c9019df168369f6da003989f7c0 100644 (file)
@@ -77,13 +77,16 @@ public sealed class GlueSystem : SharedGlueSystem
     {
         base.Update(frameTime);
 
-        var query = EntityQueryEnumerator<GluedComponent, UnremoveableComponent>();
-        while (query.MoveNext(out var uid, out var glue, out _))
+        var query = EntityQueryEnumerator<GluedComponent, UnremoveableComponent, MetaDataComponent>();
+        while (query.MoveNext(out var uid, out var glue, out var _, out var meta))
         {
             if (_timing.CurTime < glue.Until)
                 continue;
 
-            _metaData.SetEntityName(uid, glue.BeforeGluedEntityName);
+            // Instead of string matching, just reconstruct the expected name and compare
+            if (meta.EntityName == Loc.GetString("glued-name-prefix", ("target", glue.BeforeGluedEntityName)))
+                _metaData.SetEntityName(uid, glue.BeforeGluedEntityName);
+
             RemComp<UnremoveableComponent>(uid);
             RemComp<GluedComponent>(uid);
         }