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:
@@ -71,7 +71,7 @@ public abstract class SharedDamageMarkerSystem : EntitySystem
|
||||
marker.Marker = projectile.Weapon.Value;
|
||||
marker.EndTime = _timing.CurTime + component.Duration;
|
||||
component.Amount--;
|
||||
Dirty(marker);
|
||||
Dirty(args.OtherEntity, marker);
|
||||
|
||||
if (_netManager.IsServer)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public abstract class SharedDamageMarkerSystem : EntitySystem
|
||||
}
|
||||
else
|
||||
{
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,17 +21,17 @@ namespace Content.Shared.Weapons.Misc;
|
||||
|
||||
public abstract partial class SharedTetherGunSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly MobStateSystem _mob = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly SharedJointSystem _joints = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly MobStateSystem _mob = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly SharedJointSystem _joints = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
|
||||
[Dependency] private readonly ThrowingSystem _throwing = default!;
|
||||
[Dependency] private readonly ThrownItemSystem _thrown = default!;
|
||||
[Dependency] private readonly ThrowingSystem _throwing = default!;
|
||||
[Dependency] private readonly ThrownItemSystem _thrown = default!;
|
||||
|
||||
private const string TetherJoint = "tether";
|
||||
|
||||
@@ -282,7 +282,7 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
|
||||
RemComp<TetheredComponent>(component.Tethered.Value);
|
||||
_blocker.UpdateCanMove(component.Tethered.Value);
|
||||
component.Tethered = null;
|
||||
Dirty(component);
|
||||
Dirty(gunUid, component);
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -49,19 +49,19 @@ public sealed class RechargeBasicEntityAmmoSystem : EntitySystem
|
||||
if (ammo.Count == ammo.Capacity)
|
||||
{
|
||||
recharge.NextCharge = null;
|
||||
Dirty(recharge);
|
||||
Dirty(uid, recharge);
|
||||
continue;
|
||||
}
|
||||
|
||||
recharge.NextCharge = recharge.NextCharge.Value + TimeSpan.FromSeconds(recharge.RechargeCooldown);
|
||||
Dirty(recharge);
|
||||
Dirty(uid, recharge);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, RechargeBasicEntityAmmoComponent component, MapInitEvent args)
|
||||
{
|
||||
component.NextCharge = _timing.CurTime;
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid uid, RechargeBasicEntityAmmoComponent component, ExaminedEvent args)
|
||||
@@ -86,7 +86,7 @@ public sealed class RechargeBasicEntityAmmoSystem : EntitySystem
|
||||
if (recharge.NextCharge == null || recharge.NextCharge < _timing.CurTime)
|
||||
{
|
||||
recharge.NextCharge = _timing.CurTime + TimeSpan.FromSeconds(recharge.RechargeCooldown);
|
||||
Dirty(recharge);
|
||||
Dirty(uid, recharge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public sealed class RechargeCycleAmmoSystem : EntitySystem
|
||||
return;
|
||||
|
||||
_gun.UpdateBasicEntityAmmoCount(uid, basic.Count.Value + 1, basic);
|
||||
Dirty(basic);
|
||||
Dirty(uid, basic);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
if (melee.NextAttack > component.NextFire)
|
||||
{
|
||||
component.NextFire = melee.NextAttack;
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user