From 4a83c365858830e3b2ff2b94fff501256422c20e Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Tue, 19 Mar 2024 23:27:02 -0400 Subject: [PATCH] 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 --- Content.Client/Weather/WeatherSystem.cs | 6 +-- Content.IntegrationTests/Tests/Tag/TagTest.cs | 26 ++++++------ .../Systems/AdminVerbSystem.Smites.cs | 6 +-- .../EntitySystems/AtmosphereSystem.Map.cs | 6 +-- .../Atmos/EntitySystems/GasAnalyzerSystem.cs | 8 ++-- .../EntitySystems/GasTileOverlaySystem.cs | 12 +++--- .../BarSign/Systems/BarSignSystem.cs | 2 +- .../Systems/ChameleonClothingSystem.cs | 4 +- Content.Server/Decals/DecalSystem.cs | 5 ++- .../Systems/NetworkConfiguratorSystem.cs | 2 +- .../Unit/EntitySystems/DisposalUnitSystem.cs | 8 ++-- Content.Server/Dragon/DragonRiftSystem.cs | 2 +- .../Ensnaring/EnsnareableSystem.Ensnaring.cs | 6 +-- Content.Server/Ensnaring/EnsnareableSystem.cs | 2 +- Content.Server/Gravity/GravitySystem.cs | 4 +- Content.Server/HotPotato/HotPotatoSystem.cs | 4 +- .../HumanoidAppearanceSystem.Modifier.cs | 6 +-- .../Systems/HumanoidAppearanceSystem.cs | 10 ++--- .../Instruments/SwappableInstrumentSystem.cs | 2 +- .../EntitySystems/RotatingLightSystem.cs | 2 +- .../Materials/MaterialReclaimerSystem.cs | 2 +- Content.Server/Mech/Systems/MechSystem.cs | 10 ++--- .../NameIdentifier/NameIdentifierSystem.cs | 2 +- .../Physics/Controllers/ConveyorController.cs | 4 +- Content.Server/Pinpointer/NavMapSystem.cs | 20 ++++----- .../PowerCell/PowerCellSystem.Draw.cs | 4 +- .../Research/Systems/ResearchSystem.Server.cs | 8 ++-- .../Systems/ResearchSystem.Technology.cs | 8 ++-- .../Shuttles/Systems/ShuttleConsoleSystem.cs | 2 +- Content.Server/Silicons/Borgs/BorgSystem.cs | 4 +- Content.Server/Sprite/RandomSpriteSystem.cs | 2 +- .../Traits/Assorted/ParacusiaSystem.cs | 6 +-- .../Ranged/Systems/GunSystem.Battery.cs | 2 +- .../Ranged/Systems/GunSystem.Revolver.cs | 2 +- .../Systems/RandomInstrumentArtifactSystem.cs | 2 +- .../Zombies/ZombieSystem.Transform.cs | 2 +- .../Buckle/SharedBuckleSystem.Buckle.cs | 9 ++-- .../Buckle/SharedBuckleSystem.Strap.cs | 20 ++++----- .../Containers/ItemSlot/ItemSlotsSystem.cs | 6 +-- .../Damage/Systems/StaminaSystem.cs | 8 ++-- Content.Shared/Decals/SharedDecalSystem.cs | 2 +- Content.Shared/Dice/SharedDiceSystem.cs | 2 +- .../SharedElectrocutionSystem.cs | 2 +- Content.Shared/Emoting/EmoteSystem.cs | 2 +- .../Friction/TileFrictionController.cs | 2 +- .../Gravity/SharedFloatingVisualizerSystem.cs | 2 +- .../Gravity/SharedGravitySystem.Shake.cs | 4 +- .../SharedHumanoidAppearanceSystem.cs | 18 ++++---- .../Implants/SharedImplanterSystem.cs | 4 +- .../Instruments/SharedInstrumentSystem.cs | 4 +- .../Light/SharedHandheldLightSystem.cs | 2 +- .../Light/SharedRgbLightControllerSystem.cs | 6 +-- .../Mech/EntitySystems/SharedMechSystem.cs | 6 +-- .../Systems/SpeedModifierContactsSystem.cs | 2 +- .../Nutrition/EntitySystems/HungerSystem.cs | 4 +- .../Controllers/SharedConveyorController.cs | 4 +- Content.Shared/RCD/Systems/RCDAmmoSystem.cs | 4 +- Content.Shared/RCD/Systems/RCDSystem.cs | 2 +- .../EntitySystems/SharedEventHorizonSystem.cs | 8 ++-- Content.Shared/Stacks/SharedStackSystem.cs | 6 +-- .../Standing/StandingStateSystem.cs | 2 +- .../StationRecordKeyStorageSystem.cs | 2 +- .../StatusEffect/StatusEffectsSystem.cs | 12 +++--- .../Storage/EntitySystems/BinSystem.cs | 6 +-- Content.Shared/Stunnable/SharedStunSystem.cs | 32 ++++++-------- .../SubFloor/SharedTrayScannerSystem.cs | 2 +- Content.Shared/Tag/TagSystem.cs | 42 +++++++++---------- .../Systems/LinkedEntitySystem.cs | 6 +-- .../Marker/SharedDamageMarkerSystem.cs | 4 +- .../Weapons/Misc/SharedTetherGunSystem.cs | 22 +++++----- .../Systems/RechargeBasicEntityAmmoSystem.cs | 8 ++-- .../Ranged/Systems/RechargeCycleAmmoSystem.cs | 2 +- .../Weapons/Ranged/Systems/SharedGunSystem.cs | 2 +- Content.Shared/Weather/SharedWeatherSystem.cs | 20 ++++----- 74 files changed, 245 insertions(+), 249 deletions(-) diff --git a/Content.Client/Weather/WeatherSystem.cs b/Content.Client/Weather/WeatherSystem.cs index 24de0bc8c4..b35483bba4 100644 --- a/Content.Client/Weather/WeatherSystem.cs +++ b/Content.Client/Weather/WeatherSystem.cs @@ -124,9 +124,9 @@ public sealed class WeatherSystem : SharedWeatherSystem comp.Occlusion = occlusion; } - protected override bool SetState(WeatherState state, WeatherComponent comp, WeatherData weather, WeatherPrototype weatherProto) + protected override bool SetState(EntityUid uid, WeatherState state, WeatherComponent comp, WeatherData weather, WeatherPrototype weatherProto) { - if (!base.SetState(state, comp, weather, weatherProto)) + if (!base.SetState(uid, state, comp, weather, weatherProto)) return false; if (!Timing.IsFirstTimePredicted) @@ -164,7 +164,7 @@ public sealed class WeatherSystem : SharedWeatherSystem continue; // New weather - StartWeather(component, ProtoMan.Index(proto), weather.EndTime); + StartWeather(uid, component, ProtoMan.Index(proto), weather.EndTime); } } } diff --git a/Content.IntegrationTests/Tests/Tag/TagTest.cs b/Content.IntegrationTests/Tests/Tag/TagTest.cs index ed3c484b43..cbcdd1c6c6 100644 --- a/Content.IntegrationTests/Tests/Tag/TagTest.cs +++ b/Content.IntegrationTests/Tests/Tag/TagTest.cs @@ -130,9 +130,9 @@ namespace Content.IntegrationTests.Tests.Tag Assert.Multiple(() => { // Cannot add the starting tag again - Assert.That(tagSystem.AddTag(sTagComponent, StartingTag), Is.False); - Assert.That(tagSystem.AddTags(sTagComponent, StartingTag, StartingTag), Is.False); - Assert.That(tagSystem.AddTags(sTagComponent, new List { StartingTag, StartingTag }), Is.False); + Assert.That(tagSystem.AddTag(sTagDummy, sTagComponent, StartingTag), Is.False); + Assert.That(tagSystem.AddTags(sTagDummy, sTagComponent, StartingTag, StartingTag), Is.False); + Assert.That(tagSystem.AddTags(sTagDummy, sTagComponent, new List { StartingTag, StartingTag }), Is.False); // Has the starting tag Assert.That(tagSystem.HasTag(sTagComponent, StartingTag), Is.True); @@ -157,22 +157,22 @@ namespace Content.IntegrationTests.Tests.Tag Assert.That(tagSystem.HasAllTags(sTagComponent, new List { StartingTag, AddedTag }), Is.False); // Cannot remove a tag that does not exist - Assert.That(tagSystem.RemoveTag(sTagComponent, AddedTag), Is.False); - Assert.That(tagSystem.RemoveTags(sTagComponent, AddedTag, AddedTag), Is.False); - Assert.That(tagSystem.RemoveTags(sTagComponent, new List { AddedTag, AddedTag }), Is.False); + Assert.That(tagSystem.RemoveTag(sTagDummy, sTagComponent, AddedTag), Is.False); + Assert.That(tagSystem.RemoveTags(sTagDummy, sTagComponent, AddedTag, AddedTag), Is.False); + Assert.That(tagSystem.RemoveTags(sTagDummy, sTagComponent, new List { AddedTag, AddedTag }), Is.False); }); // Can add the new tag - Assert.That(tagSystem.AddTag(sTagComponent, AddedTag), Is.True); + Assert.That(tagSystem.AddTag(sTagDummy, sTagComponent, AddedTag), Is.True); Assert.Multiple(() => { // Cannot add it twice - Assert.That(tagSystem.AddTag(sTagComponent, AddedTag), Is.False); + Assert.That(tagSystem.AddTag(sTagDummy, sTagComponent, AddedTag), Is.False); // Cannot add existing tags - Assert.That(tagSystem.AddTags(sTagComponent, StartingTag, AddedTag), Is.False); - Assert.That(tagSystem.AddTags(sTagComponent, new List { StartingTag, AddedTag }), Is.False); + Assert.That(tagSystem.AddTags(sTagDummy, sTagComponent, StartingTag, AddedTag), Is.False); + Assert.That(tagSystem.AddTags(sTagDummy, sTagComponent, new List { StartingTag, AddedTag }), Is.False); // Now has two tags Assert.That(sTagComponent.Tags, Has.Count.EqualTo(2)); @@ -191,16 +191,16 @@ namespace Content.IntegrationTests.Tests.Tag Assert.Multiple(() => { // Remove the existing starting tag - Assert.That(tagSystem.RemoveTag(sTagComponent, StartingTag), Is.True); + Assert.That(tagSystem.RemoveTag(sTagDummy, sTagComponent, StartingTag), Is.True); // Remove the existing added tag - Assert.That(tagSystem.RemoveTags(sTagComponent, AddedTag, AddedTag), Is.True); + Assert.That(tagSystem.RemoveTags(sTagDummy, sTagComponent, AddedTag, AddedTag), Is.True); }); Assert.Multiple(() => { // No tags left to remove - Assert.That(tagSystem.RemoveTags(sTagComponent, new List { StartingTag, AddedTag }), Is.False); + Assert.That(tagSystem.RemoveTags(sTagDummy, sTagComponent, new List { StartingTag, AddedTag }), Is.False); // No tags left in the component Assert.That(sTagComponent.Tags, Is.Empty); diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index 8a819f5942..1047b4c9de 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -638,13 +638,13 @@ public sealed partial class AdminVerbSystem { Text = "Remove gravity", Category = VerbCategory.Smite, - Icon = new SpriteSpecifier.Rsi(new ("/Textures/Structures/Machines/gravity_generator.rsi"), "off"), + Icon = new SpriteSpecifier.Rsi(new("/Textures/Structures/Machines/gravity_generator.rsi"), "off"), Act = () => { var grav = EnsureComp(args.Target); grav.Weightless = true; - Dirty(grav); + Dirty(args.Target, grav); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-remove-gravity-description"), @@ -741,7 +741,7 @@ public sealed partial class AdminVerbSystem var movementSpeed = EnsureComp(args.Target); (movementSpeed.BaseSprintSpeed, movementSpeed.BaseWalkSpeed) = (movementSpeed.BaseWalkSpeed, movementSpeed.BaseSprintSpeed); - Dirty(movementSpeed); + Dirty(args.Target, movementSpeed); _popupSystem.PopupEntity(Loc.GetString("admin-smite-run-walk-swap-prompt"), args.Target, args.Target, PopupType.LargeCaution); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Map.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Map.cs index 916191cb05..ab59aab7e9 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Map.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Map.cs @@ -58,7 +58,7 @@ public partial class AtmosphereSystem component.Space = space; component.Mixture = mixture; - Dirty(component); + Dirty(uid, component); } public void SetMapGasMixture(EntityUid uid, GasMixture? mixture, MapAtmosphereComponent? component = null) @@ -67,7 +67,7 @@ public partial class AtmosphereSystem return; component.Mixture = mixture; - Dirty(component); + Dirty(uid, component); } public void SetMapSpace(EntityUid uid, bool space, MapAtmosphereComponent? component = null) @@ -76,6 +76,6 @@ public partial class AtmosphereSystem return; component.Space = space; - Dirty(component); + Dirty(uid, component); } } diff --git a/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs b/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs index 6a2c8f0a7e..d5563c170c 100644 --- a/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs @@ -93,9 +93,9 @@ namespace Content.Server.Atmos.EntitySystems else component.LastPosition = null; component.Enabled = true; - Dirty(component); + Dirty(uid, component); UpdateAppearance(uid, component); - if(!HasComp(uid)) + if (!HasComp(uid)) AddComp(uid); UpdateAnalyzer(uid, component); } @@ -105,7 +105,7 @@ namespace Content.Server.Atmos.EntitySystems /// private void OnDropped(EntityUid uid, GasAnalyzerComponent component, DroppedEvent args) { - if(args.User is var userId && component.Enabled) + if (args.User is var userId && component.Enabled) _popup.PopupEntity(Loc.GetString("gas-analyzer-shutoff"), userId, userId); DisableAnalyzer(uid, component, args.User); } @@ -122,7 +122,7 @@ namespace Content.Server.Atmos.EntitySystems _userInterface.TryClose(uid, GasAnalyzerUiKey.Key, actor.PlayerSession); component.Enabled = false; - Dirty(component); + Dirty(uid, component); UpdateAppearance(uid, component); RemCompDeferred(uid); } diff --git a/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs b/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs index 8ae9517379..94e095892a 100644 --- a/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs @@ -118,10 +118,11 @@ namespace Content.Server.Atmos.EntitySystems } // PVS was turned off, ensure data gets sent to all clients. - foreach (var (grid, meta) in EntityQuery(true)) + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var grid, out var meta)) { grid.ForceTick = _gameTiming.CurTick; - Dirty(grid, meta); + Dirty(uid, grid, meta); } } @@ -264,9 +265,10 @@ namespace Content.Server.Atmos.EntitySystems private void UpdateOverlayData(GameTick curTick) { // TODO parallelize? - foreach (var (overlay, gam, meta) in EntityQuery(true)) + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var overlay, out var gam, out var meta)) { - bool changed = false; + var changed = false; foreach (var index in overlay.InvalidTiles) { var chunkIndex = GetGasChunkIndices(index); @@ -278,7 +280,7 @@ namespace Content.Server.Atmos.EntitySystems } if (changed) - Dirty(overlay, meta); + Dirty(uid, overlay, meta); overlay.InvalidTiles.Clear(); } diff --git a/Content.Server/BarSign/Systems/BarSignSystem.cs b/Content.Server/BarSign/Systems/BarSignSystem.cs index 4a48140845..e42394f5a3 100644 --- a/Content.Server/BarSign/Systems/BarSignSystem.cs +++ b/Content.Server/BarSign/Systems/BarSignSystem.cs @@ -34,7 +34,7 @@ namespace Content.Server.BarSign.Systems _metaData.SetEntityDescription(uid, Loc.GetString(newPrototype.Description), meta); component.Current = newPrototype.ID; - Dirty(component); + Dirty(uid, component); } } } diff --git a/Content.Server/Clothing/Systems/ChameleonClothingSystem.cs b/Content.Server/Clothing/Systems/ChameleonClothingSystem.cs index 6fbfd9f367..23b772d99c 100644 --- a/Content.Server/Clothing/Systems/ChameleonClothingSystem.cs +++ b/Content.Server/Clothing/Systems/ChameleonClothingSystem.cs @@ -39,7 +39,7 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem args.Verbs.Add(new InteractionVerb() { Text = Loc.GetString("chameleon-component-verb-text"), - Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")), + Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")), Act = () => TryOpenUi(uid, args.User, component) }); } @@ -91,7 +91,7 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem UpdateIdentityBlocker(uid, component, proto); UpdateVisuals(uid, component); UpdateUi(uid, component); - Dirty(component); + Dirty(uid, component); } private void UpdateIdentityBlocker(EntityUid uid, ChameleonClothingComponent component, EntityPrototype proto) diff --git a/Content.Server/Decals/DecalSystem.cs b/Content.Server/Decals/DecalSystem.cs index ad225afe22..0e6c1d5ceb 100644 --- a/Content.Server/Decals/DecalSystem.cs +++ b/Content.Server/Decals/DecalSystem.cs @@ -89,10 +89,11 @@ namespace Content.Server.Decals playerData.Clear(); } - foreach (var (grid, meta) in EntityQuery(true)) + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var grid, out var meta)) { grid.ForceTick = _timing.CurTick; - Dirty(grid, meta); + Dirty(uid, grid, meta); } } diff --git a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs index 9a038f1c78..02c6538158 100644 --- a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs +++ b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs @@ -255,7 +255,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem /// private void UpdateModeAppearance(EntityUid userUid, EntityUid configuratorUid, NetworkConfiguratorComponent configurator) { - Dirty(configurator); + Dirty(configuratorUid, configurator); _appearanceSystem.SetData(configuratorUid, NetworkConfiguratorVisuals.Mode, configurator.LinkModeActive); var pitch = configurator.LinkModeActive ? 1 : 0.8f; diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index df375de695..a03ba5d231 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -340,7 +340,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem if (!args.Powered) { component.NextFlush = null; - Dirty(component); + Dirty(uid, component); return; } @@ -396,7 +396,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem component.State = state; UpdateVisualState(uid, component); UpdateInterface(uid, component, component.Powered); - Dirty(component, metadata); + Dirty(uid, component, metadata); if (state == DisposalsPressureState.Ready) { @@ -477,7 +477,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem } if (count != component.RecentlyEjected.Count) - Dirty(component, metadata); + Dirty(uid, component, metadata); } public bool TryInsert(EntityUid unitId, EntityUid toInsertId, EntityUid? userId, DisposalUnitComponent? unit = null) @@ -783,7 +783,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem var flushTime = TimeSpan.FromSeconds(Math.Min((component.NextFlush ?? TimeSpan.MaxValue).TotalSeconds, automaticTime.TotalSeconds)); component.NextFlush = flushTime; - Dirty(component); + Dirty(uid, component); } public void AfterInsert(EntityUid uid, SharedDisposalUnitComponent component, EntityUid inserted, EntityUid? user = null, bool doInsert = false) diff --git a/Content.Server/Dragon/DragonRiftSystem.cs b/Content.Server/Dragon/DragonRiftSystem.cs index f7d5cd783d..7143280900 100644 --- a/Content.Server/Dragon/DragonRiftSystem.cs +++ b/Content.Server/Dragon/DragonRiftSystem.cs @@ -67,7 +67,7 @@ public sealed class DragonRiftSystem : EntitySystem if (comp.State < DragonRiftState.AlmostFinished && comp.Accumulator > comp.MaxAccumulator / 2f) { comp.State = DragonRiftState.AlmostFinished; - Dirty(comp); + Dirty(uid, comp); var location = xform.LocalPosition; _chat.DispatchGlobalAnnouncement(Loc.GetString("carp-rift-warning", ("location", location)), playSound: false, colorOverride: Color.Red); diff --git a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs index 12c701866c..0c758141a1 100644 --- a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs +++ b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs @@ -93,7 +93,7 @@ public sealed partial class EnsnareableSystem component.Ensnared = target; _container.Insert(ensnare, ensnareable.Container); ensnareable.IsEnsnared = true; - Dirty(ensnareable); + Dirty(target, ensnareable); UpdateAlert(target, ensnareable); var ev = new EnsnareEvent(component.WalkSpeed, component.SprintSpeed); @@ -107,7 +107,7 @@ public sealed partial class EnsnareableSystem /// The entity that is freeing the target /// The entity used to ensnare /// The ensnaring component - public void TryFree(EntityUid target, EntityUid user, EntityUid ensnare, EnsnaringComponent component) + public void TryFree(EntityUid target, EntityUid user, EntityUid ensnare, EnsnaringComponent component) { //Don't do anything if they don't have the ensnareable component. if (!HasComp(target)) @@ -148,7 +148,7 @@ public sealed partial class EnsnareableSystem _container.Remove(ensnare, ensnareable.Container, force: true); ensnareable.IsEnsnared = ensnareable.Container.ContainedEntities.Count > 0; - Dirty(ensnareable); + Dirty(component.Ensnared.Value, ensnareable); component.Ensnared = null; UpdateAlert(target, ensnareable); diff --git a/Content.Server/Ensnaring/EnsnareableSystem.cs b/Content.Server/Ensnaring/EnsnareableSystem.cs index f939e087e0..d732c5f3a3 100644 --- a/Content.Server/Ensnaring/EnsnareableSystem.cs +++ b/Content.Server/Ensnaring/EnsnareableSystem.cs @@ -45,7 +45,7 @@ public sealed partial class EnsnareableSystem : SharedEnsnareableSystem } component.IsEnsnared = component.Container.ContainedEntities.Count > 0; - Dirty(component); + Dirty(uid, component); ensnaring.Ensnared = null; _hands.PickupOrDrop(args.Args.User, args.Args.Used.Value); diff --git a/Content.Server/Gravity/GravitySystem.cs b/Content.Server/Gravity/GravitySystem.cs index 5e0332ae49..ea62d4a819 100644 --- a/Content.Server/Gravity/GravitySystem.cs +++ b/Content.Server/Gravity/GravitySystem.cs @@ -41,7 +41,7 @@ namespace Content.Server.Gravity gravity.Enabled = enabled; var ev = new GravityChangedEvent(uid, enabled); RaiseLocalEvent(uid, ref ev, true); - Dirty(gravity); + Dirty(uid, gravity); if (HasComp(uid)) { @@ -71,7 +71,7 @@ namespace Content.Server.Gravity gravity.Enabled = true; var ev = new GravityChangedEvent(uid, true); RaiseLocalEvent(uid, ref ev, true); - Dirty(gravity); + Dirty(uid, gravity); if (HasComp(uid)) { diff --git a/Content.Server/HotPotato/HotPotatoSystem.cs b/Content.Server/HotPotato/HotPotatoSystem.cs index 8091eea6fd..115a7b6cb7 100644 --- a/Content.Server/HotPotato/HotPotatoSystem.cs +++ b/Content.Server/HotPotato/HotPotatoSystem.cs @@ -29,7 +29,7 @@ public sealed class HotPotatoSystem : SharedHotPotatoSystem comp.CanTransfer = false; _ambientSound.SetAmbience(uid, true); _damageOnHolding.SetEnabled(uid, true); - Dirty(comp); + Dirty(uid, comp); } private void OnMeleeHit(EntityUid uid, HotPotatoComponent comp, MeleeHitEvent args) @@ -56,6 +56,6 @@ public sealed class HotPotatoSystem : SharedHotPotatoSystem break; } comp.CanTransfer = false; - Dirty(comp); + Dirty(uid, comp); } } diff --git a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.Modifier.cs b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.Modifier.cs index 05a8b06222..336116e78b 100644 --- a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.Modifier.cs +++ b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.Modifier.cs @@ -29,7 +29,7 @@ public sealed partial class HumanoidAppearanceSystem { Text = "Modify markings", Category = VerbCategory.Tricks, - Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Customization/reptilian_parts.rsi"), "tail_smooth"), + Icon = new SpriteSpecifier.Rsi(new("/Textures/Mobs/Customization/reptilian_parts.rsi"), "tail_smooth"), Act = () => { _uiSystem.TryOpen(uid, HumanoidMarkingModifierKey.Key, actor.PlayerSession); @@ -63,7 +63,7 @@ public sealed partial class HumanoidAppearanceSystem component.CustomBaseLayers[message.Layer] = message.Info.Value; } - Dirty(component); + Dirty(uid, component); if (message.ResendState) { @@ -88,7 +88,7 @@ public sealed partial class HumanoidAppearanceSystem } component.MarkingSet = message.MarkingSet; - Dirty(component); + Dirty(uid, component); if (message.ResendState) { diff --git a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs index 039128e32f..89d28e5102 100644 --- a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs +++ b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs @@ -64,7 +64,7 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS grammar.Gender = sourceHumanoid.Gender; } - Dirty(targetHumanoid); + Dirty(target, targetHumanoid); } /// @@ -85,7 +85,7 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS humanoid.MarkingSet.Remove(prototype.MarkingCategory, marking); if (sync) - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -106,7 +106,7 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS } humanoid.MarkingSet.Remove(category, index); - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -135,7 +135,7 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS } humanoid.MarkingSet.Replace(category, index, marking); - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -162,7 +162,7 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS markings[index].SetColor(i, colors[i]); } - Dirty(humanoid); + Dirty(uid, humanoid); } /// diff --git a/Content.Server/Instruments/SwappableInstrumentSystem.cs b/Content.Server/Instruments/SwappableInstrumentSystem.cs index 3f3cfb9e6d..9aef875cd6 100644 --- a/Content.Server/Instruments/SwappableInstrumentSystem.cs +++ b/Content.Server/Instruments/SwappableInstrumentSystem.cs @@ -35,7 +35,7 @@ public sealed class SwappableInstrumentSystem : EntitySystem Priority = priority, Act = () => { - _sharedInstrument.SetInstrumentProgram(instrument, entry.Value.Item1, entry.Value.Item2); + _sharedInstrument.SetInstrumentProgram(uid, instrument, entry.Value.Item1, entry.Value.Item2); _popup.PopupEntity(Loc.GetString("swappable-instrument-component-style-set", ("style", entry.Key)), args.User, args.User); } diff --git a/Content.Server/Light/EntitySystems/RotatingLightSystem.cs b/Content.Server/Light/EntitySystems/RotatingLightSystem.cs index dd72b3a43e..7ef1357dc3 100644 --- a/Content.Server/Light/EntitySystems/RotatingLightSystem.cs +++ b/Content.Server/Light/EntitySystems/RotatingLightSystem.cs @@ -19,6 +19,6 @@ public sealed class RotatingLightSystem : SharedRotatingLightSystem return; comp.Enabled = args.Enabled; - Dirty(comp); + Dirty(uid, comp); } } diff --git a/Content.Server/Materials/MaterialReclaimerSystem.cs b/Content.Server/Materials/MaterialReclaimerSystem.cs index 8920daf60d..ae4444e059 100644 --- a/Content.Server/Materials/MaterialReclaimerSystem.cs +++ b/Content.Server/Materials/MaterialReclaimerSystem.cs @@ -130,7 +130,7 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem return false; Container.Remove(item, active.ReclaimingContainer); - Dirty(component); + Dirty(uid, component); // scales the output if the process was interrupted. var completion = 1f - Math.Clamp((float) Math.Round((active.EndTime - Timing.CurTime) / active.Duration), diff --git a/Content.Server/Mech/Systems/MechSystem.cs b/Content.Server/Mech/Systems/MechSystem.cs index 206eb894d7..2f5f8bf433 100644 --- a/Content.Server/Mech/Systems/MechSystem.cs +++ b/Content.Server/Mech/Systems/MechSystem.cs @@ -110,7 +110,7 @@ public sealed partial class MechSystem : SharedMechSystem component.Energy = battery.CurrentCharge; component.MaxEnergy = battery.MaxCharge; - Dirty(component); + Dirty(uid, component); _actionBlocker.UpdateCanMove(uid); } @@ -140,7 +140,7 @@ public sealed partial class MechSystem : SharedMechSystem component.Energy = component.MaxEnergy; _actionBlocker.UpdateCanMove(uid); - Dirty(component); + Dirty(uid, component); } private void OnRemoveEquipmentMessage(EntityUid uid, MechComponent component, MechEquipmentRemoveMessage args) @@ -338,7 +338,7 @@ public sealed partial class MechSystem : SharedMechSystem { Log.Debug($"Battery charge was not equal to mech charge. Battery {batteryComp.CurrentCharge}. Mech {component.Energy}"); component.Energy = batteryComp.CurrentCharge; - Dirty(component); + Dirty(uid, component); } _actionBlocker.UpdateCanMove(uid); return true; @@ -358,7 +358,7 @@ public sealed partial class MechSystem : SharedMechSystem _actionBlocker.UpdateCanMove(uid); - Dirty(component); + Dirty(uid, component); UpdateUserInterface(uid, component); } @@ -373,7 +373,7 @@ public sealed partial class MechSystem : SharedMechSystem _actionBlocker.UpdateCanMove(uid); - Dirty(component); + Dirty(uid, component); UpdateUserInterface(uid, component); } diff --git a/Content.Server/NameIdentifier/NameIdentifierSystem.cs b/Content.Server/NameIdentifier/NameIdentifierSystem.cs index 87953d518b..eefd4357cb 100644 --- a/Content.Server/NameIdentifier/NameIdentifierSystem.cs +++ b/Content.Server/NameIdentifier/NameIdentifierSystem.cs @@ -113,7 +113,7 @@ public sealed class NameIdentifierSystem : EntitySystem _metaData.SetEntityName(uid, group.FullName ? uniqueName : $"{meta.EntityName} ({uniqueName})", meta); - Dirty(component); + Dirty(uid, component); } private void InitialSetupPrototypes() diff --git a/Content.Server/Physics/Controllers/ConveyorController.cs b/Content.Server/Physics/Controllers/ConveyorController.cs index 42279bb749..b3508025cb 100644 --- a/Content.Server/Physics/Controllers/ConveyorController.cs +++ b/Content.Server/Physics/Controllers/ConveyorController.cs @@ -67,7 +67,7 @@ public sealed class ConveyorController : SharedConveyorController { component.Powered = args.Powered; UpdateAppearance(uid, component); - Dirty(component); + Dirty(uid, component); } private void UpdateAppearance(EntityUid uid, ConveyorComponent component) @@ -106,7 +106,7 @@ public sealed class ConveyorController : SharedConveyorController _materialReclaimer.SetReclaimerEnabled(uid, component.State != ConveyorState.Off); UpdateAppearance(uid, component); - Dirty(component); + Dirty(uid, component); } /// diff --git a/Content.Server/Pinpointer/NavMapSystem.cs b/Content.Server/Pinpointer/NavMapSystem.cs index bf3a3b2998..36fb39975e 100644 --- a/Content.Server/Pinpointer/NavMapSystem.cs +++ b/Content.Server/Pinpointer/NavMapSystem.cs @@ -54,7 +54,7 @@ public sealed class NavMapSystem : SharedNavMapSystem private void OnStationInit(StationGridAddedEvent ev) { var comp = EnsureComp(ev.GridId); - RefreshGrid(comp, Comp(ev.GridId)); + RefreshGrid(ev.GridId, comp, Comp(ev.GridId)); } private void OnNavMapBeaconStartup(EntityUid uid, NavMapBeaconComponent component, ComponentStartup args) @@ -164,7 +164,7 @@ public sealed class NavMapSystem : SharedNavMapSystem if (!TryComp(uid, out var grid)) return; - RefreshGrid(component, grid); + RefreshGrid(uid, component, grid); } private void OnNavMapSplit(ref GridSplitEvent args) @@ -177,13 +177,13 @@ public sealed class NavMapSystem : SharedNavMapSystem foreach (var grid in args.NewGrids) { var newComp = EnsureComp(grid); - RefreshGrid(newComp, gridQuery.GetComponent(grid)); + RefreshGrid(grid, newComp, gridQuery.GetComponent(grid)); } - RefreshGrid(comp, gridQuery.GetComponent(args.Grid)); + RefreshGrid(args.Grid, comp, gridQuery.GetComponent(args.Grid)); } - private void RefreshGrid(NavMapComponent component, MapGridComponent grid) + private void RefreshGrid(EntityUid uid, NavMapComponent component, MapGridComponent grid) { component.Chunks.Clear(); @@ -199,7 +199,7 @@ public sealed class NavMapSystem : SharedNavMapSystem component.Chunks[chunkOrigin] = chunk; } - RefreshTile(grid, component, chunk, tile.Value.GridIndices); + RefreshTile(uid, grid, component, chunk, tile.Value.GridIndices); } } @@ -291,7 +291,7 @@ public sealed class NavMapSystem : SharedNavMapSystem if (navMap.Chunks.TryGetValue(chunkOrigin, out var chunk)) { - RefreshTile(oldGrid, navMap, chunk, ev.TilePos); + RefreshTile(ev.OldGrid, oldGrid, navMap, chunk, ev.TilePos); } } @@ -318,10 +318,10 @@ public sealed class NavMapSystem : SharedNavMapSystem navMap.Chunks[chunkOrigin] = chunk; } - RefreshTile(grid, navMap, chunk, tile); + RefreshTile(xform.GridUid.Value, grid, navMap, chunk, tile); } - private void RefreshTile(MapGridComponent grid, NavMapComponent component, NavMapChunk chunk, Vector2i tile) + private void RefreshTile(EntityUid uid, MapGridComponent grid, NavMapComponent component, NavMapChunk chunk, Vector2i tile) { var relative = SharedMapSystem.GetChunkRelative(tile, ChunkSize); var existing = chunk.TileData; @@ -356,7 +356,7 @@ public sealed class NavMapSystem : SharedNavMapSystem if (existing == chunk.TileData) return; - Dirty(component); + Dirty(uid, component); } /// diff --git a/Content.Server/PowerCell/PowerCellSystem.Draw.cs b/Content.Server/PowerCell/PowerCellSystem.Draw.cs index 8e960357b7..4155a4f6be 100644 --- a/Content.Server/PowerCell/PowerCellSystem.Draw.cs +++ b/Content.Server/PowerCell/PowerCellSystem.Draw.cs @@ -67,7 +67,7 @@ public sealed partial class PowerCellSystem { component.CanDraw = canDraw; component.CanUse = canUse; - Dirty(component); + Dirty(uid, component); } } @@ -80,7 +80,7 @@ public sealed partial class PowerCellSystem { component.CanDraw = canDraw; component.CanUse = canUse; - Dirty(component); + Dirty(uid, component); } } } diff --git a/Content.Server/Research/Systems/ResearchSystem.Server.cs b/Content.Server/Research/Systems/ResearchSystem.Server.cs index 2a802a91a3..09ca7ed15c 100644 --- a/Content.Server/Research/Systems/ResearchSystem.Server.cs +++ b/Content.Server/Research/Systems/ResearchSystem.Server.cs @@ -18,7 +18,7 @@ public sealed partial class ResearchSystem var unusedId = EntityQuery(true) .Max(s => s.Id) + 1; component.Id = unusedId; - Dirty(component); + Dirty(uid, component); } private void OnServerShutdown(EntityUid uid, ResearchServerComponent component, ComponentShutdown args) @@ -74,7 +74,7 @@ public sealed partial class ResearchSystem SyncClientWithServer(client, clientComponent: clientComponent); if (dirtyServer) - Dirty(serverComponent); + Dirty(server, serverComponent); var ev = new ResearchRegistrationChangedEvent(server); RaiseLocalEvent(client, ref ev); @@ -117,7 +117,7 @@ public sealed partial class ResearchSystem if (dirtyServer) { - Dirty(serverComponent); + Dirty(server, serverComponent); } var ev = new ResearchRegistrationChangedEvent(null); @@ -167,6 +167,6 @@ public sealed partial class ResearchSystem { RaiseLocalEvent(client, ref ev); } - Dirty(component); + Dirty(uid, component); } } diff --git a/Content.Server/Research/Systems/ResearchSystem.Technology.cs b/Content.Server/Research/Systems/ResearchSystem.Technology.cs index 107d51ccd8..9bd71cf7c6 100644 --- a/Content.Server/Research/Systems/ResearchSystem.Technology.cs +++ b/Content.Server/Research/Systems/ResearchSystem.Technology.cs @@ -21,7 +21,7 @@ public sealed partial class ResearchSystem primaryDb.UnlockedTechnologies = otherDb.UnlockedTechnologies; primaryDb.UnlockedRecipes = otherDb.UnlockedRecipes; - Dirty(primaryDb); + Dirty(primaryUid, primaryDb); var ev = new TechnologyDatabaseModifiedEvent(); RaiseLocalEvent(primaryUid, ref ev); @@ -125,7 +125,7 @@ public sealed partial class ResearchSystem continue; component.UnlockedRecipes.Add(unlock); } - Dirty(component); + Dirty(uid, component); var ev = new TechnologyDatabaseModifiedEvent(); RaiseLocalEvent(uid, ref ev); @@ -144,7 +144,7 @@ public sealed partial class ResearchSystem return; component.UnlockedRecipes.Add(recipe); - Dirty(component); + Dirty(uid, component); var ev = new TechnologyDatabaseModifiedEvent(); RaiseLocalEvent(uid, ref ev); @@ -185,6 +185,6 @@ public sealed partial class ResearchSystem component.SupportedDisciplines = new List(); component.UnlockedTechnologies = new List(); component.UnlockedRecipes = new List(); - Dirty(component); + Dirty(uid, component); } } diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs index c47c519d5d..f0368ed3a9 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs @@ -318,7 +318,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem pilotComponent.Console = uid; ActionBlockerSystem.UpdateCanMove(entity); pilotComponent.Position = EntityManager.GetComponent(entity).Coordinates; - Dirty(pilotComponent); + Dirty(entity, pilotComponent); } public void RemovePilot(EntityUid pilotUid, PilotComponent pilotComponent) diff --git a/Content.Server/Silicons/Borgs/BorgSystem.cs b/Content.Server/Silicons/Borgs/BorgSystem.cs index 869c279704..0f14fef0ed 100644 --- a/Content.Server/Silicons/Borgs/BorgSystem.cs +++ b/Content.Server/Silicons/Borgs/BorgSystem.cs @@ -281,7 +281,7 @@ public sealed partial class BorgSystem : SharedBorgSystem component.Activated = true; InstallAllModules(uid, component); - Dirty(component); + Dirty(uid, component); _movementSpeedModifier.RefreshMovementSpeedModifiers(uid); } @@ -295,7 +295,7 @@ public sealed partial class BorgSystem : SharedBorgSystem component.Activated = false; DisableAllModules(uid, component); - Dirty(component); + Dirty(uid, component); _movementSpeedModifier.RefreshMovementSpeedModifiers(uid); } diff --git a/Content.Server/Sprite/RandomSpriteSystem.cs b/Content.Server/Sprite/RandomSpriteSystem.cs index 5d04dd2f5a..7f81f4bdd4 100644 --- a/Content.Server/Sprite/RandomSpriteSystem.cs +++ b/Content.Server/Sprite/RandomSpriteSystem.cs @@ -63,7 +63,7 @@ public sealed class RandomSpriteSystem: SharedRandomSpriteSystem } } - Dirty(component); + Dirty(uid, component); } private void OnGetState(EntityUid uid, RandomSpriteComponent component, ref ComponentGetState args) diff --git a/Content.Server/Traits/Assorted/ParacusiaSystem.cs b/Content.Server/Traits/Assorted/ParacusiaSystem.cs index 4b0205ff53..fbbeb9f1a7 100644 --- a/Content.Server/Traits/Assorted/ParacusiaSystem.cs +++ b/Content.Server/Traits/Assorted/ParacusiaSystem.cs @@ -12,7 +12,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem return; } component.Sounds = sounds; - Dirty(component); + Dirty(uid, component); } public void SetTime(EntityUid uid, float minTime, float maxTime, ParacusiaComponent? component = null) @@ -23,7 +23,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem } component.MinTimeBetweenIncidents = minTime; component.MaxTimeBetweenIncidents = maxTime; - Dirty(component); + Dirty(uid, component); } public void SetDistance(EntityUid uid, float maxSoundDistance, ParacusiaComponent? component = null) @@ -33,6 +33,6 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem return; } component.MaxSoundDistance = maxSoundDistance; - Dirty(component); + Dirty(uid, component); } } diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs index 25010b2233..0dcd92f941 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs @@ -51,7 +51,7 @@ public sealed partial class GunSystem if (component.Shots != shots || component.Capacity != maxShots) { - Dirty(component); + Dirty(uid, component); } component.Shots = shots; diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.Revolver.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.Revolver.cs index 6ff4750729..59e53f1f72 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.Revolver.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.Revolver.cs @@ -13,6 +13,6 @@ public sealed partial class GunSystem return; component.CurrentIndex = index; - Dirty(component); + Dirty(revolverUid, component); } } diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomInstrumentArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomInstrumentArtifactSystem.cs index 8945b86795..118bc396a7 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomInstrumentArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomInstrumentArtifactSystem.cs @@ -18,6 +18,6 @@ public sealed class RandomInstrumentArtifactSystem : EntitySystem private void OnStartup(EntityUid uid, RandomInstrumentArtifactComponent component, ComponentStartup args) { var instrument = EnsureComp(uid); - _instrument.SetInstrumentProgram(instrument, (byte) _random.Next(0, 127), 0); + _instrument.SetInstrumentProgram(uid, instrument, (byte) _random.Next(0, 127), 0); } } diff --git a/Content.Server/Zombies/ZombieSystem.Transform.cs b/Content.Server/Zombies/ZombieSystem.Transform.cs index 63cc873086..23e1c2bb92 100644 --- a/Content.Server/Zombies/ZombieSystem.Transform.cs +++ b/Content.Server/Zombies/ZombieSystem.Transform.cs @@ -185,7 +185,7 @@ namespace Content.Server.Zombies Dirty(target, pryComp); } - Dirty(melee); + Dirty(target, melee); //The zombie gets the assigned damage weaknesses and strengths _damageable.SetDamageModifierSetId(target, "Zombie"); diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index 2527f74553..70e816b16e 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -54,7 +54,7 @@ public abstract partial class SharedBuckleSystem private void OnBuckleMove(EntityUid uid, BuckleComponent component, ref MoveEvent ev) { - if (component.BuckledTo is not {} strapUid) + if (component.BuckledTo is not { } strapUid) return; if (!TryComp(strapUid, out var strapComp)) @@ -85,7 +85,7 @@ public abstract partial class SharedBuckleSystem { Act = () => TryUnbuckle(uid, args.User, buckleComp: component), Text = Loc.GetString("verb-categories-unbuckle"), - Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/unbuckle.svg.192dpi.png")) + Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/unbuckle.svg.192dpi.png")) }; if (args.Target == args.User && args.Using == null) @@ -191,7 +191,7 @@ public abstract partial class SharedBuckleSystem ActionBlocker.UpdateCanMove(buckleUid); UpdateBuckleStatus(buckleUid, buckleComp, strapComp); - Dirty(buckleComp); + Dirty(buckleUid, buckleComp); } /// @@ -468,8 +468,7 @@ public abstract partial class SharedBuckleSystem if (strapComp.BuckledEntities.Remove(buckleUid)) { strapComp.OccupiedSize -= buckleComp.Size; - //Dirty(strapUid); - Dirty(strapComp); + Dirty(strapUid, strapComp); } _joints.RefreshRelay(buckleUid); diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs b/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs index 7be5436074..147af42e72 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs @@ -20,22 +20,22 @@ public abstract partial class SharedBuckleSystem { SubscribeLocalEvent(OnStrapStartup); SubscribeLocalEvent(OnStrapShutdown); - SubscribeLocalEvent((_, c, _) => StrapRemoveAll(c)); + SubscribeLocalEvent((e, c, _) => StrapRemoveAll(e, c)); SubscribeLocalEvent(OnStrapEntModifiedFromContainer); SubscribeLocalEvent(OnStrapEntModifiedFromContainer); SubscribeLocalEvent>(AddStrapVerbs); SubscribeLocalEvent(OnStrapContainerGettingInsertedAttempt); SubscribeLocalEvent(OnStrapInteractHand); - SubscribeLocalEvent((_,c,_) => StrapRemoveAll(c)); - SubscribeLocalEvent((_, c, _) => StrapRemoveAll(c)); + SubscribeLocalEvent((e, c, _) => StrapRemoveAll(e, c)); + SubscribeLocalEvent((e, c, _) => StrapRemoveAll(e, c)); SubscribeLocalEvent(OnStrapDragDropTarget); SubscribeLocalEvent(OnCanDropTarget); SubscribeLocalEvent(OnAttemptFold); SubscribeLocalEvent(OnStrapMoveEvent); - SubscribeLocalEvent((_, c, _) => StrapRemoveAll(c)); + SubscribeLocalEvent((e, c, _) => StrapRemoveAll(e, c)); } private void OnStrapStartup(EntityUid uid, StrapComponent component, ComponentStartup args) @@ -48,7 +48,7 @@ public abstract partial class SharedBuckleSystem if (LifeStage(uid) > EntityLifeStage.MapInitialized) return; - StrapRemoveAll(component); + StrapRemoveAll(uid, component); } private void OnStrapEntModifiedFromContainer(EntityUid uid, StrapComponent component, ContainerModifiedMessage message) @@ -153,7 +153,7 @@ public abstract partial class SharedBuckleSystem } // If the user is currently holding/pulling an entity that can be buckled, add a verb for that. - if (args.Using is {Valid: true} @using && + if (args.Using is { Valid: true } @using && TryComp(@using, out var usingBuckle) && StrapHasSpace(uid, usingBuckle, component) && _interaction.InRangeUnobstructed(@using, args.Target, range: usingBuckle.Range)) @@ -232,7 +232,7 @@ public abstract partial class SharedBuckleSystem } ReAttach(buckledEntity, uid, buckled, component); - Dirty(buckled); + Dirty(buckledEntity, buckled); } } @@ -258,7 +258,7 @@ public abstract partial class SharedBuckleSystem /// /// Remove everything attached to the strap /// - private void StrapRemoveAll(StrapComponent strapComp) + private void StrapRemoveAll(EntityUid uid, StrapComponent strapComp) { foreach (var entity in strapComp.BuckledEntities.ToArray()) { @@ -267,7 +267,7 @@ public abstract partial class SharedBuckleSystem strapComp.BuckledEntities.Clear(); strapComp.OccupiedSize = 0; - Dirty(strapComp); + Dirty(uid, strapComp); } private bool StrapHasSpace(EntityUid strapUid, BuckleComponent buckleComp, StrapComponent? strapComp = null) @@ -313,6 +313,6 @@ public abstract partial class SharedBuckleSystem strapComp.Enabled = enabled; if (!enabled) - StrapRemoveAll(strapComp); + StrapRemoveAll(strapUid, strapComp); } } diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs index fb50803596..3463be2e71 100644 --- a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs +++ b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs @@ -89,7 +89,7 @@ namespace Content.Shared.Containers.ItemSlots /// public void AddItemSlot(EntityUid uid, string id, ItemSlot slot, ItemSlotsComponent? itemSlots = null) { - itemSlots ??= EntityManager.EnsureComponent(uid); + itemSlots ??= EnsureComp(uid); DebugTools.AssertOwner(uid, itemSlots); if (itemSlots.Slots.TryGetValue(id, out var existing)) @@ -103,7 +103,7 @@ namespace Content.Shared.Containers.ItemSlots slot.ContainerSlot = _containers.EnsureContainer(uid, id); itemSlots.Slots[id] = slot; - Dirty(itemSlots); + Dirty(uid, itemSlots); } /// @@ -127,7 +127,7 @@ namespace Content.Shared.Containers.ItemSlots if (itemSlots.Slots.Count == 0) EntityManager.RemoveComponent(uid, itemSlots); else - Dirty(itemSlots); + Dirty(uid, itemSlots); } public bool TryGetSlot(EntityUid uid, string slotId, [NotNullWhen(true)] out ItemSlot? itemSlot, ItemSlotsComponent? component = null) diff --git a/Content.Shared/Damage/Systems/StaminaSystem.cs b/Content.Shared/Damage/Systems/StaminaSystem.cs index b8ea953f25..840b2e0431 100644 --- a/Content.Shared/Damage/Systems/StaminaSystem.cs +++ b/Content.Shared/Damage/Systems/StaminaSystem.cs @@ -285,7 +285,7 @@ public sealed partial class StaminaSystem : EntitySystem } EnsureComp(uid); - Dirty(component); + Dirty(uid, component); if (value <= 0) return; @@ -345,7 +345,7 @@ public sealed partial class StaminaSystem : EntitySystem comp.NextUpdate += TimeSpan.FromSeconds(1f); TakeStaminaDamage(uid, -comp.Decay, comp); - Dirty(comp); + Dirty(uid, comp); } } @@ -368,7 +368,7 @@ public sealed partial class StaminaSystem : EntitySystem // Give them buffer before being able to be re-stunned component.NextUpdate = _timing.CurTime + component.StunTime + StamCritBufferTime; EnsureComp(uid); - Dirty(component); + Dirty(uid, component); _adminLogger.Add(LogType.Stamina, LogImpact.Medium, $"{ToPrettyString(uid):user} entered stamina crit"); } @@ -385,7 +385,7 @@ public sealed partial class StaminaSystem : EntitySystem component.NextUpdate = _timing.CurTime; SetStaminaAlert(uid, component); RemComp(uid); - Dirty(component); + Dirty(uid, component); _adminLogger.Add(LogType.Stamina, LogImpact.Low, $"{ToPrettyString(uid):user} recovered from stamina crit"); } } diff --git a/Content.Shared/Decals/SharedDecalSystem.cs b/Content.Shared/Decals/SharedDecalSystem.cs index 76fa9d64db..0665ccbf84 100644 --- a/Content.Shared/Decals/SharedDecalSystem.cs +++ b/Content.Shared/Decals/SharedDecalSystem.cs @@ -69,7 +69,7 @@ namespace Content.Shared.Decals // This **shouldn't** be required, but just in case we ever get entity prototypes that have decal grids, we // need to ensure that we send an initial full state to players. - Dirty(component); + Dirty(uid, component); } protected Dictionary? ChunkCollection(EntityUid gridEuid, DecalGridComponent? comp = null) diff --git a/Content.Shared/Dice/SharedDiceSystem.cs b/Content.Shared/Dice/SharedDiceSystem.cs index defb3d5f0e..8e2868e791 100644 --- a/Content.Shared/Dice/SharedDiceSystem.cs +++ b/Content.Shared/Dice/SharedDiceSystem.cs @@ -59,7 +59,7 @@ public abstract class SharedDiceSystem : EntitySystem } die.CurrentValue = (side - die.Offset) * die.Multiplier; - Dirty(die); + Dirty(uid, die); UpdateVisuals(uid, die); } diff --git a/Content.Shared/Electrocution/SharedElectrocutionSystem.cs b/Content.Shared/Electrocution/SharedElectrocutionSystem.cs index 5031d8a911..b228a987af 100644 --- a/Content.Shared/Electrocution/SharedElectrocutionSystem.cs +++ b/Content.Shared/Electrocution/SharedElectrocutionSystem.cs @@ -20,7 +20,7 @@ namespace Content.Shared.Electrocution return; insulated.Coefficient = siemensCoefficient; - Dirty(insulated); + Dirty(uid, insulated); } /// Entity being electrocuted. diff --git a/Content.Shared/Emoting/EmoteSystem.cs b/Content.Shared/Emoting/EmoteSystem.cs index fd6361245b..1e06d7e982 100644 --- a/Content.Shared/Emoting/EmoteSystem.cs +++ b/Content.Shared/Emoting/EmoteSystem.cs @@ -19,7 +19,7 @@ public sealed class EmoteSystem : EntitySystem if (component.Enabled == value) return; - Dirty(component); + Dirty(uid, component); } private void OnEmoteAttempt(EmoteAttemptEvent args) diff --git a/Content.Shared/Friction/TileFrictionController.cs b/Content.Shared/Friction/TileFrictionController.cs index 3583947ee3..930de07dab 100644 --- a/Content.Shared/Friction/TileFrictionController.cs +++ b/Content.Shared/Friction/TileFrictionController.cs @@ -214,7 +214,7 @@ namespace Content.Shared.Friction return; friction.Modifier = value; - Dirty(friction); + Dirty(entityUid, friction); } } } diff --git a/Content.Shared/Gravity/SharedFloatingVisualizerSystem.cs b/Content.Shared/Gravity/SharedFloatingVisualizerSystem.cs index 57136116ca..6ca974f2ed 100644 --- a/Content.Shared/Gravity/SharedFloatingVisualizerSystem.cs +++ b/Content.Shared/Gravity/SharedFloatingVisualizerSystem.cs @@ -33,7 +33,7 @@ public abstract class SharedFloatingVisualizerSystem : EntitySystem return false; component.CanFloat = GravitySystem.IsWeightless(uid, xform: transform); - Dirty(component); + Dirty(uid, component); return component.CanFloat; } diff --git a/Content.Shared/Gravity/SharedGravitySystem.Shake.cs b/Content.Shared/Gravity/SharedGravitySystem.Shake.cs index ad2e0e3ad5..41cf616cc4 100644 --- a/Content.Shared/Gravity/SharedGravitySystem.Shake.cs +++ b/Content.Shared/Gravity/SharedGravitySystem.Shake.cs @@ -24,7 +24,7 @@ public abstract partial class SharedGravitySystem ShakeGrid(uid, gravity); comp.ShakeTimes--; comp.NextShake += TimeSpan.FromSeconds(ShakeCooldown); - Dirty(comp); + Dirty(uid, comp); } } } @@ -44,7 +44,7 @@ public abstract partial class SharedGravitySystem } shake.ShakeTimes = 10; - Dirty(shake); + Dirty(uid, shake); } protected virtual void ShakeGrid(EntityUid uid, GravityComponent? comp = null) {} diff --git a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs index 597afcbda2..b7ef784d00 100644 --- a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs +++ b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs @@ -99,7 +99,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem } if (dirty) - Dirty(humanoid); + Dirty(uid, humanoid); } protected virtual void SetLayerVisibility( @@ -147,7 +147,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem humanoid.MarkingSet = new(oldMarkings, prototype.MarkingPoints, _markingManager, _prototypeManager); if (sync) - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -177,7 +177,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem humanoid.SkinColor = skinColor; if (sync) - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -201,7 +201,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem humanoid.CustomBaseLayers[layer] = new(id); if (sync) - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -222,7 +222,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem humanoid.CustomBaseLayers[layer] = new(null, color); if (sync) - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -244,7 +244,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem if (sync) { - Dirty(humanoid); + Dirty(uid, humanoid); } } @@ -329,7 +329,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem humanoid.Age = profile.Age; - Dirty(humanoid); + Dirty(uid, humanoid); } /// @@ -362,7 +362,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem humanoid.MarkingSet.AddBack(prototype.MarkingCategory, markingObject); if (sync) - Dirty(humanoid); + Dirty(uid, humanoid); } private void EnsureDefaultMarkings(EntityUid uid, HumanoidAppearanceComponent? humanoid) @@ -396,6 +396,6 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem humanoid.MarkingSet.AddBack(prototype.MarkingCategory, markingObject); if (sync) - Dirty(humanoid); + Dirty(uid, humanoid); } } diff --git a/Content.Shared/Implants/SharedImplanterSystem.cs b/Content.Shared/Implants/SharedImplanterSystem.cs index 36a31bac1d..d78522b56c 100644 --- a/Content.Shared/Implants/SharedImplanterSystem.cs +++ b/Content.Shared/Implants/SharedImplanterSystem.cs @@ -77,7 +77,7 @@ public abstract class SharedImplanterSystem : EntitySystem var ev = new TransferDnaEvent { Donor = target, Recipient = implanter }; RaiseLocalEvent(target, ref ev); - Dirty(component); + Dirty(implanter, component); } public bool CanImplant( @@ -156,7 +156,7 @@ public abstract class SharedImplanterSystem : EntitySystem if (component.CurrentMode == ImplanterToggleMode.Draw && !component.ImplantOnly && !permanentFound) ImplantMode(implanter, component); - Dirty(component); + Dirty(implanter, component); } } diff --git a/Content.Shared/Instruments/SharedInstrumentSystem.cs b/Content.Shared/Instruments/SharedInstrumentSystem.cs index 87e3a69489..23bcf67de0 100644 --- a/Content.Shared/Instruments/SharedInstrumentSystem.cs +++ b/Content.Shared/Instruments/SharedInstrumentSystem.cs @@ -12,10 +12,10 @@ public abstract class SharedInstrumentSystem : EntitySystem { } - public void SetInstrumentProgram(SharedInstrumentComponent component, byte program, byte bank) + public void SetInstrumentProgram(EntityUid uid, SharedInstrumentComponent component, byte program, byte bank) { component.InstrumentBank = bank; component.InstrumentProgram = program; - Dirty(component); + Dirty(uid, component); } } diff --git a/Content.Shared/Light/SharedHandheldLightSystem.cs b/Content.Shared/Light/SharedHandheldLightSystem.cs index 2fa15800a3..9bec37a314 100644 --- a/Content.Shared/Light/SharedHandheldLightSystem.cs +++ b/Content.Shared/Light/SharedHandheldLightSystem.cs @@ -29,7 +29,7 @@ public abstract class SharedHandheldLightSystem : EntitySystem UpdateVisuals(uid, component); // Want to make sure client has latest data on level so battery displays properly. - Dirty(component); + Dirty(uid, component); } private void OnHandleState(EntityUid uid, HandheldLightComponent component, ref ComponentHandleState args) diff --git a/Content.Shared/Light/SharedRgbLightControllerSystem.cs b/Content.Shared/Light/SharedRgbLightControllerSystem.cs index 1bba91c5e7..7d4928f5bc 100644 --- a/Content.Shared/Light/SharedRgbLightControllerSystem.cs +++ b/Content.Shared/Light/SharedRgbLightControllerSystem.cs @@ -17,13 +17,13 @@ public abstract class SharedRgbLightControllerSystem : EntitySystem args.State = new RgbLightControllerState(component.CycleRate, component.Layers); } - public void SetLayers(EntityUid uid, List? layers, RgbLightControllerComponent? rgb = null) + public void SetLayers(EntityUid uid, List? layers, RgbLightControllerComponent? rgb = null) { if (!Resolve(uid, ref rgb)) return; rgb.Layers = layers; - Dirty(rgb); + Dirty(uid, rgb); } public void SetCycleRate(EntityUid uid, float rate, RgbLightControllerComponent? rgb = null) @@ -32,6 +32,6 @@ public abstract class SharedRgbLightControllerSystem : EntitySystem return; rgb.CycleRate = Math.Clamp(0.01f, rate, 1); // lets not give people seizures - Dirty(rgb); + Dirty(uid, rgb); } } diff --git a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs index df0d7b78f0..97b5bfeba6 100644 --- a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs +++ b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs @@ -194,7 +194,7 @@ public abstract class SharedMechSystem : EntitySystem if (_net.IsServer) _popup.PopupEntity(popupString, uid); - Dirty(component); + Dirty(uid, component); } /// @@ -278,7 +278,7 @@ public abstract class SharedMechSystem : EntitySystem return false; component.Energy = FixedPoint2.Clamp(component.Energy + delta, 0, component.MaxEnergy); - Dirty(component); + Dirty(uid, component); UpdateUserInterface(uid, component); return true; } @@ -306,7 +306,7 @@ public abstract class SharedMechSystem : EntitySystem UpdateAppearance(uid, component); } - Dirty(component); + Dirty(uid, component); UpdateUserInterface(uid, component); } diff --git a/Content.Shared/Movement/Systems/SpeedModifierContactsSystem.cs b/Content.Shared/Movement/Systems/SpeedModifierContactsSystem.cs index f9f6b82bb1..400a675cd2 100644 --- a/Content.Shared/Movement/Systems/SpeedModifierContactsSystem.cs +++ b/Content.Shared/Movement/Systems/SpeedModifierContactsSystem.cs @@ -58,7 +58,7 @@ public sealed class SpeedModifierContactsSystem : EntitySystem } component.WalkSpeedModifier = walkSpeed; component.SprintSpeedModifier = sprintSpeed; - Dirty(component); + Dirty(uid, component); _toUpdate.UnionWith(_physics.GetContactingEntities(uid)); } diff --git a/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs b/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs index d8808b6e4a..89aae57074 100644 --- a/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs +++ b/Content.Shared/Nutrition/EntitySystems/HungerSystem.cs @@ -85,7 +85,7 @@ public sealed class HungerSystem : EntitySystem component.Thresholds[HungerThreshold.Dead], component.Thresholds[HungerThreshold.Overfed]); UpdateCurrentThreshold(uid, component); - Dirty(component); + Dirty(uid, component); } private void UpdateCurrentThreshold(EntityUid uid, HungerComponent? component = null) @@ -98,7 +98,7 @@ public sealed class HungerSystem : EntitySystem return; component.CurrentThreshold = calculatedHungerThreshold; DoHungerThresholdEffects(uid, component); - Dirty(component); + Dirty(uid, component); } private void DoHungerThresholdEffects(EntityUid uid, HungerComponent? component = null, bool force = false) diff --git a/Content.Shared/Physics/Controllers/SharedConveyorController.cs b/Content.Shared/Physics/Controllers/SharedConveyorController.cs index ec17df7a24..bbbfb47cd1 100644 --- a/Content.Shared/Physics/Controllers/SharedConveyorController.cs +++ b/Content.Shared/Physics/Controllers/SharedConveyorController.cs @@ -100,10 +100,10 @@ public abstract class SharedConveyorController : VirtualController transform.LocalPosition = localPos; // Force it awake for collisionwake reasons. - Physics.SetAwake(entity, body, true); + Physics.SetAwake((entity, body), true); Physics.SetSleepTime(body, 0f); } - Dirty(comp); + Dirty(uid, comp); } private static Vector2 Convey(Vector2 direction, float speed, float frameTime, Vector2 itemRelative) diff --git a/Content.Shared/RCD/Systems/RCDAmmoSystem.cs b/Content.Shared/RCD/Systems/RCDAmmoSystem.cs index 9481d299aa..9cb3c26485 100644 --- a/Content.Shared/RCD/Systems/RCDAmmoSystem.cs +++ b/Content.Shared/RCD/Systems/RCDAmmoSystem.cs @@ -36,7 +36,7 @@ public sealed class RCDAmmoSystem : EntitySystem if (args.Handled || !args.CanReach || !_timing.IsFirstTimePredicted) return; - if (args.Target is not {Valid: true} target || + if (args.Target is not { Valid: true } target || !HasComp(target) || !TryComp(target, out var charges)) return; @@ -53,7 +53,7 @@ public sealed class RCDAmmoSystem : EntitySystem _popup.PopupClient(Loc.GetString("rcd-ammo-component-after-interact-refilled"), target, user); _charges.AddCharges(target, count, charges); comp.Charges -= count; - Dirty(comp); + Dirty(uid, comp); // prevent having useless ammo with 0 charges if (comp.Charges <= 0) diff --git a/Content.Shared/RCD/Systems/RCDSystem.cs b/Content.Shared/RCD/Systems/RCDSystem.cs index f767d0b99c..d8f01bd410 100644 --- a/Content.Shared/RCD/Systems/RCDSystem.cs +++ b/Content.Shared/RCD/Systems/RCDSystem.cs @@ -312,7 +312,7 @@ public sealed class RCDSystem : EntitySystem var mode = (int) comp.Mode; mode = ++mode % RcdModeCount; comp.Mode = (RcdMode) mode; - Dirty(comp); + Dirty(uid, comp); var msg = Loc.GetString("rcd-component-change-mode", ("mode", comp.Mode.ToString())); _popup.PopupClient(msg, uid, user); diff --git a/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs b/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs index f31dd8776a..c2b52c5af3 100644 --- a/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs +++ b/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs @@ -66,7 +66,7 @@ public abstract class SharedEventHorizonSystem : EntitySystem return; eventHorizon.Radius = value; - Dirty(eventHorizon); + Dirty(uid, eventHorizon); if (updateFixture) UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon); } @@ -89,7 +89,7 @@ public abstract class SharedEventHorizonSystem : EntitySystem return; eventHorizon.CanBreachContainment = value; - Dirty(eventHorizon); + Dirty(uid, eventHorizon); if (updateFixture) UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon); } @@ -112,7 +112,7 @@ public abstract class SharedEventHorizonSystem : EntitySystem return; eventHorizon.ColliderFixtureId = value; - Dirty(eventHorizon); + Dirty(uid, eventHorizon); if (updateFixture) UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon); } @@ -135,7 +135,7 @@ public abstract class SharedEventHorizonSystem : EntitySystem return; eventHorizon.ConsumerFixtureId = value; - Dirty(eventHorizon); + Dirty(uid, eventHorizon); if (updateFixture) UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon); } diff --git a/Content.Shared/Stacks/SharedStackSystem.cs b/Content.Shared/Stacks/SharedStackSystem.cs index 756c84cac5..e12edd323c 100644 --- a/Content.Shared/Stacks/SharedStackSystem.cs +++ b/Content.Shared/Stacks/SharedStackSystem.cs @@ -23,8 +23,8 @@ namespace Content.Shared.Stacks [Dependency] protected readonly SharedAppearanceSystem Appearance = default!; [Dependency] protected readonly SharedHandsSystem Hands = default!; [Dependency] protected readonly SharedTransformSystem Xform = default!; - [Dependency] private readonly EntityLookupSystem _entityLookup = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; + [Dependency] private readonly EntityLookupSystem _entityLookup = default!; + [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] protected readonly SharedPopupSystem Popup = default!; [Dependency] private readonly SharedStorageSystem _storage = default!; @@ -175,7 +175,7 @@ namespace Content.Shared.Stacks // Server-side override deletes the entity if count == 0 component.Count = amount; - Dirty(component); + Dirty(uid, component); Appearance.SetData(uid, StackVisuals.Actual, component.Count); RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count)); diff --git a/Content.Shared/Standing/StandingStateSystem.cs b/Content.Shared/Standing/StandingStateSystem.cs index 517831b8a1..ed586e970d 100644 --- a/Content.Shared/Standing/StandingStateSystem.cs +++ b/Content.Shared/Standing/StandingStateSystem.cs @@ -56,7 +56,7 @@ namespace Content.Shared.Standing return false; standingState.Standing = false; - Dirty(standingState); + Dirty(uid, standingState); RaiseLocalEvent(uid, new DownedEvent(), false); // Seemed like the best place to put it diff --git a/Content.Shared/StationRecords/StationRecordKeyStorageSystem.cs b/Content.Shared/StationRecords/StationRecordKeyStorageSystem.cs index 05af0807f2..e9d68721b6 100644 --- a/Content.Shared/StationRecords/StationRecordKeyStorageSystem.cs +++ b/Content.Shared/StationRecords/StationRecordKeyStorageSystem.cs @@ -58,7 +58,7 @@ public sealed class StationRecordKeyStorageSystem : EntitySystem var key = keyStorage.Key; keyStorage.Key = null; - Dirty(keyStorage); + Dirty(uid, keyStorage); return key; } diff --git a/Content.Shared/StatusEffect/StatusEffectsSystem.cs b/Content.Shared/StatusEffect/StatusEffectsSystem.cs index 6aec3a8b3b..f3e3e12bd8 100644 --- a/Content.Shared/StatusEffect/StatusEffectsSystem.cs +++ b/Content.Shared/StatusEffect/StatusEffectsSystem.cs @@ -207,7 +207,7 @@ namespace Content.Shared.StatusEffect _alertsSystem.ShowAlert(uid, proto.Alert.Value, null, cooldown1); } - Dirty(status); + Dirty(uid, status); RaiseLocalEvent(uid, new StatusEffectAddedEvent(uid, key)); return true; } @@ -283,7 +283,7 @@ namespace Content.Shared.StatusEffect RemComp(uid); } - Dirty(status); + Dirty(uid, status); RaiseLocalEvent(uid, new StatusEffectEndedEvent(uid, key)); return true; } @@ -307,7 +307,7 @@ namespace Content.Shared.StatusEffect failed = true; } - Dirty(status); + Dirty(uid, status); return failed; } @@ -381,7 +381,7 @@ namespace Content.Shared.StatusEffect _alertsSystem.ShowAlert(uid, proto.Alert.Value, null, cooldown); } - Dirty(status); + Dirty(uid, status); return true; } @@ -417,7 +417,7 @@ namespace Content.Shared.StatusEffect _alertsSystem.ShowAlert(uid, proto.Alert.Value, null, cooldown); } - Dirty(status); + Dirty(uid, status); return true; } @@ -438,7 +438,7 @@ namespace Content.Shared.StatusEffect status.ActiveEffects[key].Cooldown = (_gameTiming.CurTime, _gameTiming.CurTime + time); - Dirty(status); + Dirty(uid, status); return true; } diff --git a/Content.Shared/Storage/EntitySystems/BinSystem.cs b/Content.Shared/Storage/EntitySystems/BinSystem.cs index 17c3eb4288..1cc95337ea 100644 --- a/Content.Shared/Storage/EntitySystems/BinSystem.cs +++ b/Content.Shared/Storage/EntitySystems/BinSystem.cs @@ -135,7 +135,7 @@ public sealed class BinSystem : EntitySystem _container.Insert(toInsert, component.ItemContainer); component.Items.Add(toInsert); - Dirty(component); + Dirty(uid, component); return true; } @@ -151,7 +151,7 @@ public sealed class BinSystem : EntitySystem if (!Resolve(uid, ref component)) return false; - if (!component.Items.Any()) + if (component.Items.Count == 0) return false; if (toRemove == null || toRemove != component.Items.LastOrDefault()) @@ -161,7 +161,7 @@ public sealed class BinSystem : EntitySystem return false; component.Items.Remove(toRemove.Value); - Dirty(component); + Dirty(uid, component); return true; } } diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index c447f8c8bc..9190427d32 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -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; } diff --git a/Content.Shared/SubFloor/SharedTrayScannerSystem.cs b/Content.Shared/SubFloor/SharedTrayScannerSystem.cs index 1ba88c571c..da56c8d1c7 100644 --- a/Content.Shared/SubFloor/SharedTrayScannerSystem.cs +++ b/Content.Shared/SubFloor/SharedTrayScannerSystem.cs @@ -35,7 +35,7 @@ public abstract class SharedTrayScannerSystem : EntitySystem return; scanner.Enabled = enabled; - Dirty(scanner); + Dirty(uid, scanner); // We don't remove from _activeScanners on disabled, because the update function will handle that, as well as // managing the revealed subfloor entities diff --git a/Content.Shared/Tag/TagSystem.cs b/Content.Shared/Tag/TagSystem.cs index 0628b892ed..62197dc319 100644 --- a/Content.Shared/Tag/TagSystem.cs +++ b/Content.Shared/Tag/TagSystem.cs @@ -75,7 +75,7 @@ public sealed class TagSystem : EntitySystem /// public bool AddTag(EntityUid entity, string id) { - return AddTag(EnsureComp(entity), id); + return AddTag(entity, EnsureComp(entity), id); } /// @@ -91,7 +91,7 @@ public sealed class TagSystem : EntitySystem /// public bool AddTags(EntityUid entity, params string[] ids) { - return AddTags(EnsureComp(entity), ids); + return AddTags(entity, EnsureComp(entity), ids); } /// @@ -107,7 +107,7 @@ public sealed class TagSystem : EntitySystem /// public bool AddTags(EntityUid entity, IEnumerable ids) { - return AddTags(EnsureComp(entity), ids); + return AddTags(entity, EnsureComp(entity), ids); } /// @@ -125,7 +125,7 @@ public sealed class TagSystem : EntitySystem public bool TryAddTag(EntityUid entity, string id) { return TryComp(entity, out var component) && - AddTag(component, id); + AddTag(entity, component, id); } /// @@ -143,7 +143,7 @@ public sealed class TagSystem : EntitySystem public bool TryAddTags(EntityUid entity, params string[] ids) { return TryComp(entity, out var component) && - AddTags(component, ids); + AddTags(entity, component, ids); } /// @@ -161,7 +161,7 @@ public sealed class TagSystem : EntitySystem public bool TryAddTags(EntityUid entity, IEnumerable ids) { return TryComp(entity, out var component) && - AddTags(component, ids); + AddTags(entity, component, ids); } /// @@ -299,7 +299,7 @@ public sealed class TagSystem : EntitySystem public bool RemoveTag(EntityUid entity, string id) { return TryComp(entity, out var component) && - RemoveTag(component, id); + RemoveTag(entity, component, id); } /// @@ -316,7 +316,7 @@ public sealed class TagSystem : EntitySystem public bool RemoveTags(EntityUid entity, params string[] ids) { return TryComp(entity, out var component) && - RemoveTags(component, ids); + RemoveTags(entity, component, ids); } /// @@ -333,7 +333,7 @@ public sealed class TagSystem : EntitySystem public bool RemoveTags(EntityUid entity, IEnumerable ids) { return TryComp(entity, out var component) && - RemoveTags(component, ids); + RemoveTags(entity, component, ids); } /// @@ -344,14 +344,14 @@ public sealed class TagSystem : EntitySystem /// /// Thrown if no exists with the given id. /// - public bool AddTag(TagComponent component, string id) + public bool AddTag(EntityUid uid, TagComponent component, string id) { AssertValidTag(id); var added = component.Tags.Add(id); if (added) { - Dirty(component); + Dirty(uid, component); return true; } @@ -366,9 +366,9 @@ public sealed class TagSystem : EntitySystem /// /// Thrown if one of the ids represents an unregistered . /// - public bool AddTags(TagComponent component, params string[] ids) + public bool AddTags(EntityUid uid, TagComponent component, params string[] ids) { - return AddTags(component, ids.AsEnumerable()); + return AddTags(uid, component, ids.AsEnumerable()); } /// @@ -379,7 +379,7 @@ public sealed class TagSystem : EntitySystem /// /// Thrown if one of the ids represents an unregistered . /// - public bool AddTags(TagComponent component, IEnumerable ids) + public bool AddTags(EntityUid uid, TagComponent component, IEnumerable ids) { var count = component.Tags.Count; @@ -391,7 +391,7 @@ public sealed class TagSystem : EntitySystem if (component.Tags.Count > count) { - Dirty(component); + Dirty(uid, component); return true; } @@ -557,13 +557,13 @@ public sealed class TagSystem : EntitySystem /// /// Thrown if no exists with the given id. /// - public bool RemoveTag(TagComponent component, string id) + public bool RemoveTag(EntityUid uid, TagComponent component, string id) { AssertValidTag(id); if (component.Tags.Remove(id)) { - Dirty(component); + Dirty(uid, component); return true; } @@ -580,9 +580,9 @@ public sealed class TagSystem : EntitySystem /// /// Thrown if one of the ids represents an unregistered . /// - public bool RemoveTags(TagComponent component, params string[] ids) + public bool RemoveTags(EntityUid uid, TagComponent component, params string[] ids) { - return RemoveTags(component, ids.AsEnumerable()); + return RemoveTags(uid, component, ids.AsEnumerable()); } /// @@ -593,7 +593,7 @@ public sealed class TagSystem : EntitySystem /// /// Thrown if one of the ids represents an unregistered . /// - public bool RemoveTags(TagComponent component, IEnumerable ids) + public bool RemoveTags(EntityUid uid, TagComponent component, IEnumerable ids) { var count = component.Tags.Count; @@ -605,7 +605,7 @@ public sealed class TagSystem : EntitySystem if (component.Tags.Count < count) { - Dirty(component); + Dirty(uid, component); return true; } diff --git a/Content.Shared/Teleportation/Systems/LinkedEntitySystem.cs b/Content.Shared/Teleportation/Systems/LinkedEntitySystem.cs index bf2d087c76..35ce5665dd 100644 --- a/Content.Shared/Teleportation/Systems/LinkedEntitySystem.cs +++ b/Content.Shared/Teleportation/Systems/LinkedEntitySystem.cs @@ -87,7 +87,7 @@ public sealed class LinkedEntitySystem : EntitySystem /// Resolve comp /// Whether unlinking was successful (e.g. they both were actually linked to one another) public bool TryUnlink(EntityUid first, EntityUid second, - LinkedEntityComponent? firstLink=null, LinkedEntityComponent? secondLink=null) + LinkedEntityComponent? firstLink = null, LinkedEntityComponent? secondLink = null) { if (!Resolve(first, ref firstLink)) return false; @@ -101,8 +101,8 @@ public sealed class LinkedEntitySystem : EntitySystem _appearance.SetData(first, LinkedEntityVisuals.HasAnyLinks, firstLink.LinkedEntities.Any()); _appearance.SetData(second, LinkedEntityVisuals.HasAnyLinks, secondLink.LinkedEntities.Any()); - Dirty(firstLink); - Dirty(secondLink); + Dirty(first, firstLink); + Dirty(second, secondLink); if (firstLink.LinkedEntities.Count == 0 && firstLink.DeleteOnEmptyLinks) QueueDel(first); diff --git a/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs b/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs index 63b2d5f211..d1814020e6 100644 --- a/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs +++ b/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs @@ -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); } } } diff --git a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs index 177cb310d1..99cd3fa030 100644 --- a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs +++ b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs @@ -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(component.Tethered.Value); _blocker.UpdateCanMove(component.Tethered.Value); component.Tethered = null; - Dirty(component); + Dirty(gunUid, component); } [Serializable, NetSerializable] diff --git a/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs b/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs index b774c8ab45..9d6d552400 100644 --- a/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs @@ -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); } } } diff --git a/Content.Shared/Weapons/Ranged/Systems/RechargeCycleAmmoSystem.cs b/Content.Shared/Weapons/Ranged/Systems/RechargeCycleAmmoSystem.cs index 136e9b59b2..a014f8e5c7 100644 --- a/Content.Shared/Weapons/Ranged/Systems/RechargeCycleAmmoSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/RechargeCycleAmmoSystem.cs @@ -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; } } diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 71e3e80764..c97e2b4555 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -117,7 +117,7 @@ public abstract partial class SharedGunSystem : EntitySystem if (melee.NextAttack > component.NextFire) { component.NextFire = melee.NextAttack; - Dirty(component); + Dirty(uid, component); } } diff --git a/Content.Shared/Weather/SharedWeatherSystem.cs b/Content.Shared/Weather/SharedWeatherSystem.cs index 45a2afe7cd..19671bd77b 100644 --- a/Content.Shared/Weather/SharedWeatherSystem.cs +++ b/Content.Shared/Weather/SharedWeatherSystem.cs @@ -15,8 +15,8 @@ public abstract class SharedWeatherSystem : EntitySystem [Dependency] protected readonly IGameTiming Timing = default!; [Dependency] protected readonly IMapManager MapManager = default!; [Dependency] protected readonly IPrototypeManager ProtoMan = default!; - [Dependency] private readonly ITileDefinitionManager _tileDefManager = default!; - [Dependency] private readonly MetaDataSystem _metadata = default!; + [Dependency] private readonly ITileDefinitionManager _tileDefManager = default!; + [Dependency] private readonly MetaDataSystem _metadata = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; private EntityQuery _blockQuery; @@ -129,7 +129,7 @@ public abstract class SharedWeatherSystem : EntitySystem // Shutting down if (endTime != null && remainingTime < WeatherComponent.ShutdownTime) { - SetState(WeatherState.Ending, comp, weather, weatherProto); + SetState(uid, WeatherState.Ending, comp, weather, weatherProto); } // Starting up else @@ -139,7 +139,7 @@ public abstract class SharedWeatherSystem : EntitySystem if (elapsed < WeatherComponent.StartupTime) { - SetState(WeatherState.Starting, comp, weather, weatherProto); + SetState(uid, WeatherState.Starting, comp, weather, weatherProto); } } @@ -182,15 +182,15 @@ public abstract class SharedWeatherSystem : EntitySystem } if (proto != null) - StartWeather(weatherComp, proto, endTime); + StartWeather(mapUid, weatherComp, proto, endTime); } /// /// Run every tick when the weather is running. /// - protected virtual void Run(EntityUid uid, WeatherData weather, WeatherPrototype weatherProto, float frameTime) {} + protected virtual void Run(EntityUid uid, WeatherData weather, WeatherPrototype weatherProto, float frameTime) { } - protected void StartWeather(WeatherComponent component, WeatherPrototype weather, TimeSpan? endTime) + protected void StartWeather(EntityUid uid, WeatherComponent component, WeatherPrototype weather, TimeSpan? endTime) { if (component.Weather.ContainsKey(weather.ID)) return; @@ -202,7 +202,7 @@ public abstract class SharedWeatherSystem : EntitySystem }; component.Weather.Add(weather.ID, data); - Dirty(component); + Dirty(uid, component); } protected virtual void EndWeather(EntityUid uid, WeatherComponent component, string proto) @@ -216,13 +216,13 @@ public abstract class SharedWeatherSystem : EntitySystem Dirty(uid, component); } - protected virtual bool SetState(WeatherState state, WeatherComponent component, WeatherData weather, WeatherPrototype weatherProto) + protected virtual bool SetState(EntityUid uid, WeatherState state, WeatherComponent component, WeatherData weather, WeatherPrototype weatherProto) { if (weather.State.Equals(state)) return false; weather.State = state; - Dirty(component); + Dirty(uid, component); return true; }