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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<ActiveGasAnalyzerComponent>(uid))
|
||||
if (!HasComp<ActiveGasAnalyzerComponent>(uid))
|
||||
AddComp<ActiveGasAnalyzerComponent>(uid);
|
||||
UpdateAnalyzer(uid, component);
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
/// </summary>
|
||||
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<ActiveGasAnalyzerComponent>(uid);
|
||||
}
|
||||
|
||||
@@ -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<GasTileOverlayComponent, MetaDataComponent>(true))
|
||||
var query = EntityQueryEnumerator<GasTileOverlayComponent, MetaDataComponent>();
|
||||
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<GasTileOverlayComponent, GridAtmosphereComponent, MetaDataComponent>(true))
|
||||
var query = EntityQueryEnumerator<GasTileOverlayComponent, GridAtmosphereComponent, MetaDataComponent>();
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user