]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix fish petting misprediction (#30175)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Sat, 20 Jul 2024 03:23:46 +0000 (03:23 +0000)
committerGitHub <noreply@github.com>
Sat, 20 Jul 2024 03:23:46 +0000 (13:23 +1000)
* make fish petting ignore use delay

* m

* troll

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Shared/Friends/Systems/PettableFriendSystem.cs

index 00a4ddd155c36c01af953527f2bde77d9f00d859..6e41f4bdea964249865194dddb4fb15e1c4af0a9 100644 (file)
@@ -32,23 +32,23 @@ public sealed class PettableFriendSystem : EntitySystem
     {
         var (uid, comp) = ent;
         var user = args.User;
-        if (args.Handled || !_exceptionQuery.TryGetComponent(uid, out var exceptionComp))
-            return;
-
-        if (_useDelayQuery.TryGetComponent(uid, out var useDelay) && !_useDelay.TryResetDelay((uid, useDelay), true))
+        if (args.Handled || !_exceptionQuery.TryComp(uid, out var exceptionComp))
             return;
 
         var exception = (uid, exceptionComp);
-        if (_factionException.IsIgnored(exception, user))
+        if (!_factionException.IsIgnored(exception, user))
         {
-            _popup.PopupClient(Loc.GetString(comp.FailureString, ("target", uid)), user, user);
+            // you have made a new friend :)
+            _popup.PopupClient(Loc.GetString(comp.SuccessString, ("target", uid)), user, user);
+            _factionException.IgnoreEntity(exception, user);
+            args.Handled = true;
             return;
         }
 
-        // you have made a new friend :)
-        _popup.PopupClient(Loc.GetString(comp.SuccessString, ("target", uid)), user, user);
-        _factionException.IgnoreEntity(exception, user);
-        args.Handled = true;
+        if (_useDelayQuery.TryComp(uid, out var useDelay) && !_useDelay.TryResetDelay((uid, useDelay), true))
+            return;
+
+        _popup.PopupClient(Loc.GetString(comp.FailureString, ("target", uid)), user, user);
     }
 
     private void OnRehydrated(Entity<PettableFriendComponent> ent, ref GotRehydratedEvent args)