Code cleanup: Dirty(Comp) (#26238)

* Replaced uses of Dirty(Component) with Dirty(Uid, Component)
Modified some systems (notably pulling-related) to use uids.

* Missed a few

* Revert changes to pulling

* No
This commit is contained in:
Tayrtahn
2024-03-19 23:27:02 -04:00
committed by GitHub
parent c28cbe40c3
commit 4a83c36585
74 changed files with 245 additions and 249 deletions

View File

@@ -1,7 +1,5 @@
using Content.Shared.ActionBlocker;
using Content.Shared.Administration.Logs;
using Content.Shared.Audio;
using Content.Shared.DragDrop;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Inventory.Events;
@@ -11,16 +9,12 @@ using Content.Shared.Database;
using Content.Shared.Hands;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Events;
using Content.Shared.Movement.Systems;
using Content.Shared.Standing;
using Content.Shared.StatusEffect;
using Content.Shared.Throwing;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
namespace Content.Shared.Stunnable;
@@ -82,19 +76,19 @@ public abstract class SharedStunSystem : EntitySystem
switch (args.NewMobState)
{
case MobState.Alive:
{
break;
}
{
break;
}
case MobState.Critical:
{
_statusEffect.TryRemoveStatusEffect(uid, "Stun");
break;
}
{
_statusEffect.TryRemoveStatusEffect(uid, "Stun");
break;
}
case MobState.Dead:
{
_statusEffect.TryRemoveStatusEffect(uid, "Stun");
break;
}
{
_statusEffect.TryRemoveStatusEffect(uid, "Stun");
break;
}
case MobState.Invalid:
default:
return;
@@ -238,11 +232,11 @@ public abstract class SharedStunSystem : EntitySystem
return;
// Set it to half the help interval so helping is actually useful...
knocked.HelpTimer = knocked.HelpInterval/2f;
knocked.HelpTimer = knocked.HelpInterval / 2f;
_statusEffect.TryRemoveTime(uid, "KnockedDown", TimeSpan.FromSeconds(knocked.HelpInterval));
_audio.PlayPredicted(knocked.StunAttemptSound, uid, args.User);
Dirty(knocked);
Dirty(uid, knocked);
args.Handled = true;
}