]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Chameleon PDAs renaming the user in station records (#35782)
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Tue, 11 Mar 2025 13:52:38 +0000 (14:52 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Mar 2025 13:52:38 +0000 (14:52 +0100)
Content.Server/StationRecords/Systems/StationRecordsSystem.cs

index a5332022ee389eea70752e5e0201d12e0e4f1371..5957b98cd71d761535538506481e0776fc73a620 100644 (file)
@@ -64,7 +64,8 @@ public sealed class StationRecordsSystem : SharedStationRecordsSystem
         // Unfortunately this means that an event is called for it as well, and since TryFindIdCard will succeed if the
         // given entity is a card and the card itself is the key the record will be mistakenly renamed to the card's name
         // if we don't return early.
-        if (HasComp<IdCardComponent>(ev.Uid))
+        // We also do not include the PDA itself being renamed, as that triggers the same event (e.g. for chameleon PDAs).
+        if (HasComp<IdCardComponent>(ev.Uid) ||  HasComp<PdaComponent>(ev.Uid))
             return;
 
         if (_idCard.TryFindIdCard(ev.Uid, out var idCard))