fix fish petting misprediction (#30175)

* make fish petting ignore use delay

* m

* troll

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-07-20 03:23:46 +00:00
committed by GitHub
parent 6972bc26a7
commit 8be13bf495

View 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)