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)
continue;
// New weather
- StartWeather(component, ProtoMan.Index<WeatherPrototype>(proto), weather.EndTime);
+ StartWeather(uid, component, ProtoMan.Index<WeatherPrototype>(proto), weather.EndTime);
}
}
}
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<string> { 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<string> { StartingTag, StartingTag }), Is.False);
// Has the starting tag
Assert.That(tagSystem.HasTag(sTagComponent, StartingTag), Is.True);
Assert.That(tagSystem.HasAllTags(sTagComponent, new List<string> { 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<string> { 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<string> { 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<string> { StartingTag, AddedTag }), Is.False);
+ Assert.That(tagSystem.AddTags(sTagDummy, sTagComponent, StartingTag, AddedTag), Is.False);
+ Assert.That(tagSystem.AddTags(sTagDummy, sTagComponent, new List<string> { StartingTag, AddedTag }), Is.False);
// Now has two tags
Assert.That(sTagComponent.Tags, Has.Count.EqualTo(2));
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<string> { StartingTag, AddedTag }), Is.False);
+ Assert.That(tagSystem.RemoveTags(sTagDummy, sTagComponent, new List<string> { StartingTag, AddedTag }), Is.False);
// No tags left in the component
Assert.That(sTagComponent.Tags, Is.Empty);
{
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<MovementIgnoreGravityComponent>(args.Target);
grav.Weightless = true;
- Dirty(grav);
+ Dirty(args.Target, grav);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-gravity-description"),
var movementSpeed = EnsureComp<MovementSpeedModifierComponent>(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);
component.Space = space;
component.Mixture = mixture;
- Dirty(component);
+ Dirty(uid, component);
}
public void SetMapGasMixture(EntityUid uid, GasMixture? mixture, MapAtmosphereComponent? component = null)
return;
component.Mixture = mixture;
- Dirty(component);
+ Dirty(uid, component);
}
public void SetMapSpace(EntityUid uid, bool space, MapAtmosphereComponent? component = null)
return;
component.Space = space;
- Dirty(component);
+ Dirty(uid, component);
}
}
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);
}
/// </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);
}
_userInterface.TryClose(uid, GasAnalyzerUiKey.Key, actor.PlayerSession);
component.Enabled = false;
- Dirty(component);
+ Dirty(uid, component);
UpdateAppearance(uid, component);
RemCompDeferred<ActiveGasAnalyzerComponent>(uid);
}
}
// 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);
}
}
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);
}
if (changed)
- Dirty(overlay, meta);
+ Dirty(uid, overlay, meta);
overlay.InvalidTiles.Clear();
}
_metaData.SetEntityDescription(uid, Loc.GetString(newPrototype.Description), meta);
component.Current = newPrototype.ID;
- Dirty(component);
+ Dirty(uid, component);
}
}
}
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)
});
}
UpdateIdentityBlocker(uid, component, proto);
UpdateVisuals(uid, component);
UpdateUi(uid, component);
- Dirty(component);
+ Dirty(uid, component);
}
private void UpdateIdentityBlocker(EntityUid uid, ChameleonClothingComponent component, EntityPrototype proto)
playerData.Clear();
}
- foreach (var (grid, meta) in EntityQuery<DecalGridComponent, MetaDataComponent>(true))
+ var query = EntityQueryEnumerator<DecalGridComponent, MetaDataComponent>();
+ while (query.MoveNext(out var uid, out var grid, out var meta))
{
grid.ForceTick = _timing.CurTick;
- Dirty(grid, meta);
+ Dirty(uid, grid, meta);
}
}
/// </summary>
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;
if (!args.Powered)
{
component.NextFlush = null;
- Dirty(component);
+ Dirty(uid, component);
return;
}
component.State = state;
UpdateVisualState(uid, component);
UpdateInterface(uid, component, component.Powered);
- Dirty(component, metadata);
+ Dirty(uid, component, metadata);
if (state == DisposalsPressureState.Ready)
{
}
if (count != component.RecentlyEjected.Count)
- Dirty(component, metadata);
+ Dirty(uid, component, metadata);
}
public bool TryInsert(EntityUid unitId, EntityUid toInsertId, EntityUid? userId, DisposalUnitComponent? unit = null)
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)
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);
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);
/// <param name="user">The entity that is freeing the target</param>
/// <param name="ensnare">The entity used to ensnare</param>
/// <param name="component">The ensnaring component</param>
- 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<EnsnareableComponent>(target))
_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);
}
component.IsEnsnared = component.Container.ContainedEntities.Count > 0;
- Dirty(component);
+ Dirty(uid, component);
ensnaring.Ensnared = null;
_hands.PickupOrDrop(args.Args.User, args.Args.Used.Value);
gravity.Enabled = enabled;
var ev = new GravityChangedEvent(uid, enabled);
RaiseLocalEvent(uid, ref ev, true);
- Dirty(gravity);
+ Dirty(uid, gravity);
if (HasComp<MapGridComponent>(uid))
{
gravity.Enabled = true;
var ev = new GravityChangedEvent(uid, true);
RaiseLocalEvent(uid, ref ev, true);
- Dirty(gravity);
+ Dirty(uid, gravity);
if (HasComp<MapGridComponent>(uid))
{
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)
break;
}
comp.CanTransfer = false;
- Dirty(comp);
+ Dirty(uid, comp);
}
}
{
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);
component.CustomBaseLayers[message.Layer] = message.Info.Value;
}
- Dirty(component);
+ Dirty(uid, component);
if (message.ResendState)
{
}
component.MarkingSet = message.MarkingSet;
- Dirty(component);
+ Dirty(uid, component);
if (message.ResendState)
{
grammar.Gender = sourceHumanoid.Gender;
}
- Dirty(targetHumanoid);
+ Dirty(target, targetHumanoid);
}
/// <summary>
humanoid.MarkingSet.Remove(prototype.MarkingCategory, marking);
if (sync)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
}
humanoid.MarkingSet.Remove(category, index);
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
}
humanoid.MarkingSet.Replace(category, index, marking);
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
markings[index].SetColor(i, colors[i]);
}
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
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);
}
return;
comp.Enabled = args.Enabled;
- Dirty(comp);
+ Dirty(uid, comp);
}
}
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),
component.Energy = battery.CurrentCharge;
component.MaxEnergy = battery.MaxCharge;
- Dirty(component);
+ Dirty(uid, component);
_actionBlocker.UpdateCanMove(uid);
}
component.Energy = component.MaxEnergy;
_actionBlocker.UpdateCanMove(uid);
- Dirty(component);
+ Dirty(uid, component);
}
private void OnRemoveEquipmentMessage(EntityUid uid, MechComponent component, MechEquipmentRemoveMessage args)
{
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;
_actionBlocker.UpdateCanMove(uid);
- Dirty(component);
+ Dirty(uid, component);
UpdateUserInterface(uid, component);
}
_actionBlocker.UpdateCanMove(uid);
- Dirty(component);
+ Dirty(uid, component);
UpdateUserInterface(uid, component);
}
_metaData.SetEntityName(uid, group.FullName
? uniqueName
: $"{meta.EntityName} ({uniqueName})", meta);
- Dirty(component);
+ Dirty(uid, component);
}
private void InitialSetupPrototypes()
{
component.Powered = args.Powered;
UpdateAppearance(uid, component);
- Dirty(component);
+ Dirty(uid, component);
}
private void UpdateAppearance(EntityUid uid, ConveyorComponent component)
_materialReclaimer.SetReclaimerEnabled(uid, component.State != ConveyorState.Off);
UpdateAppearance(uid, component);
- Dirty(component);
+ Dirty(uid, component);
}
/// <summary>
private void OnStationInit(StationGridAddedEvent ev)
{
var comp = EnsureComp<NavMapComponent>(ev.GridId);
- RefreshGrid(comp, Comp<MapGridComponent>(ev.GridId));
+ RefreshGrid(ev.GridId, comp, Comp<MapGridComponent>(ev.GridId));
}
private void OnNavMapBeaconStartup(EntityUid uid, NavMapBeaconComponent component, ComponentStartup args)
if (!TryComp<MapGridComponent>(uid, out var grid))
return;
- RefreshGrid(component, grid);
+ RefreshGrid(uid, component, grid);
}
private void OnNavMapSplit(ref GridSplitEvent args)
foreach (var grid in args.NewGrids)
{
var newComp = EnsureComp<NavMapComponent>(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();
component.Chunks[chunkOrigin] = chunk;
}
- RefreshTile(grid, component, chunk, tile.Value.GridIndices);
+ RefreshTile(uid, grid, component, chunk, tile.Value.GridIndices);
}
}
if (navMap.Chunks.TryGetValue(chunkOrigin, out var chunk))
{
- RefreshTile(oldGrid, navMap, chunk, ev.TilePos);
+ RefreshTile(ev.OldGrid, oldGrid, navMap, chunk, ev.TilePos);
}
}
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;
if (existing == chunk.TileData)
return;
- Dirty(component);
+ Dirty(uid, component);
}
/// <summary>
{
component.CanDraw = canDraw;
component.CanUse = canUse;
- Dirty(component);
+ Dirty(uid, component);
}
}
{
component.CanDraw = canDraw;
component.CanUse = canUse;
- Dirty(component);
+ Dirty(uid, component);
}
}
}
var unusedId = EntityQuery<ResearchServerComponent>(true)
.Max(s => s.Id) + 1;
component.Id = unusedId;
- Dirty(component);
+ Dirty(uid, component);
}
private void OnServerShutdown(EntityUid uid, ResearchServerComponent component, ComponentShutdown args)
SyncClientWithServer(client, clientComponent: clientComponent);
if (dirtyServer)
- Dirty(serverComponent);
+ Dirty(server, serverComponent);
var ev = new ResearchRegistrationChangedEvent(server);
RaiseLocalEvent(client, ref ev);
if (dirtyServer)
{
- Dirty(serverComponent);
+ Dirty(server, serverComponent);
}
var ev = new ResearchRegistrationChangedEvent(null);
{
RaiseLocalEvent(client, ref ev);
}
- Dirty(component);
+ Dirty(uid, component);
}
}
primaryDb.UnlockedTechnologies = otherDb.UnlockedTechnologies;
primaryDb.UnlockedRecipes = otherDb.UnlockedRecipes;
- Dirty(primaryDb);
+ Dirty(primaryUid, primaryDb);
var ev = new TechnologyDatabaseModifiedEvent();
RaiseLocalEvent(primaryUid, ref ev);
continue;
component.UnlockedRecipes.Add(unlock);
}
- Dirty(component);
+ Dirty(uid, component);
var ev = new TechnologyDatabaseModifiedEvent();
RaiseLocalEvent(uid, ref ev);
return;
component.UnlockedRecipes.Add(recipe);
- Dirty(component);
+ Dirty(uid, component);
var ev = new TechnologyDatabaseModifiedEvent();
RaiseLocalEvent(uid, ref ev);
component.SupportedDisciplines = new List<string>();
component.UnlockedTechnologies = new List<string>();
component.UnlockedRecipes = new List<string>();
- Dirty(component);
+ Dirty(uid, component);
}
}
pilotComponent.Console = uid;
ActionBlockerSystem.UpdateCanMove(entity);
pilotComponent.Position = EntityManager.GetComponent<TransformComponent>(entity).Coordinates;
- Dirty(pilotComponent);
+ Dirty(entity, pilotComponent);
}
public void RemovePilot(EntityUid pilotUid, PilotComponent pilotComponent)
component.Activated = true;
InstallAllModules(uid, component);
- Dirty(component);
+ Dirty(uid, component);
_movementSpeedModifier.RefreshMovementSpeedModifiers(uid);
}
component.Activated = false;
DisableAllModules(uid, component);
- Dirty(component);
+ Dirty(uid, component);
_movementSpeedModifier.RefreshMovementSpeedModifiers(uid);
}
}
}
- Dirty(component);
+ Dirty(uid, component);
}
private void OnGetState(EntityUid uid, RandomSpriteComponent component, ref ComponentGetState args)
return;
}
component.Sounds = sounds;
- Dirty(component);
+ Dirty(uid, component);
}
public void SetTime(EntityUid uid, float minTime, float maxTime, ParacusiaComponent? component = null)
}
component.MinTimeBetweenIncidents = minTime;
component.MaxTimeBetweenIncidents = maxTime;
- Dirty(component);
+ Dirty(uid, component);
}
public void SetDistance(EntityUid uid, float maxSoundDistance, ParacusiaComponent? component = null)
return;
}
component.MaxSoundDistance = maxSoundDistance;
- Dirty(component);
+ Dirty(uid, component);
}
}
if (component.Shots != shots || component.Capacity != maxShots)
{
- Dirty(component);
+ Dirty(uid, component);
}
component.Shots = shots;
return;
component.CurrentIndex = index;
- Dirty(component);
+ Dirty(revolverUid, component);
}
}
private void OnStartup(EntityUid uid, RandomInstrumentArtifactComponent component, ComponentStartup args)
{
var instrument = EnsureComp<InstrumentComponent>(uid);
- _instrument.SetInstrumentProgram(instrument, (byte) _random.Next(0, 127), 0);
+ _instrument.SetInstrumentProgram(uid, instrument, (byte) _random.Next(0, 127), 0);
}
}
Dirty(target, pryComp);
}
- Dirty(melee);
+ Dirty(target, melee);
//The zombie gets the assigned damage weaknesses and strengths
_damageable.SetDamageModifierSetId(target, "Zombie");
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<StrapComponent>(strapUid, out var strapComp))
{
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)
ActionBlocker.UpdateCanMove(buckleUid);
UpdateBuckleStatus(buckleUid, buckleComp, strapComp);
- Dirty(buckleComp);
+ Dirty(buckleUid, buckleComp);
}
/// <summary>
if (strapComp.BuckledEntities.Remove(buckleUid))
{
strapComp.OccupiedSize -= buckleComp.Size;
- //Dirty(strapUid);
- Dirty(strapComp);
+ Dirty(strapUid, strapComp);
}
_joints.RefreshRelay(buckleUid);
{
SubscribeLocalEvent<StrapComponent, ComponentStartup>(OnStrapStartup);
SubscribeLocalEvent<StrapComponent, ComponentShutdown>(OnStrapShutdown);
- SubscribeLocalEvent<StrapComponent, ComponentRemove>((_, c, _) => StrapRemoveAll(c));
+ SubscribeLocalEvent<StrapComponent, ComponentRemove>((e, c, _) => StrapRemoveAll(e, c));
SubscribeLocalEvent<StrapComponent, EntInsertedIntoContainerMessage>(OnStrapEntModifiedFromContainer);
SubscribeLocalEvent<StrapComponent, EntRemovedFromContainerMessage>(OnStrapEntModifiedFromContainer);
SubscribeLocalEvent<StrapComponent, GetVerbsEvent<InteractionVerb>>(AddStrapVerbs);
SubscribeLocalEvent<StrapComponent, ContainerGettingInsertedAttemptEvent>(OnStrapContainerGettingInsertedAttempt);
SubscribeLocalEvent<StrapComponent, InteractHandEvent>(OnStrapInteractHand);
- SubscribeLocalEvent<StrapComponent, DestructionEventArgs>((_,c,_) => StrapRemoveAll(c));
- SubscribeLocalEvent<StrapComponent, BreakageEventArgs>((_, c, _) => StrapRemoveAll(c));
+ SubscribeLocalEvent<StrapComponent, DestructionEventArgs>((e, c, _) => StrapRemoveAll(e, c));
+ SubscribeLocalEvent<StrapComponent, BreakageEventArgs>((e, c, _) => StrapRemoveAll(e, c));
SubscribeLocalEvent<StrapComponent, DragDropTargetEvent>(OnStrapDragDropTarget);
SubscribeLocalEvent<StrapComponent, CanDropTargetEvent>(OnCanDropTarget);
SubscribeLocalEvent<StrapComponent, FoldAttemptEvent>(OnAttemptFold);
SubscribeLocalEvent<StrapComponent, MoveEvent>(OnStrapMoveEvent);
- SubscribeLocalEvent<StrapComponent, MachineDeconstructedEvent>((_, c, _) => StrapRemoveAll(c));
+ SubscribeLocalEvent<StrapComponent, MachineDeconstructedEvent>((e, c, _) => StrapRemoveAll(e, c));
}
private void OnStrapStartup(EntityUid uid, StrapComponent component, ComponentStartup args)
if (LifeStage(uid) > EntityLifeStage.MapInitialized)
return;
- StrapRemoveAll(component);
+ StrapRemoveAll(uid, component);
}
private void OnStrapEntModifiedFromContainer(EntityUid uid, StrapComponent component, ContainerModifiedMessage message)
}
// 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<BuckleComponent>(@using, out var usingBuckle) &&
StrapHasSpace(uid, usingBuckle, component) &&
_interaction.InRangeUnobstructed(@using, args.Target, range: usingBuckle.Range))
}
ReAttach(buckledEntity, uid, buckled, component);
- Dirty(buckled);
+ Dirty(buckledEntity, buckled);
}
}
/// <summary>
/// Remove everything attached to the strap
/// </summary>
- private void StrapRemoveAll(StrapComponent strapComp)
+ private void StrapRemoveAll(EntityUid uid, StrapComponent strapComp)
{
foreach (var entity in strapComp.BuckledEntities.ToArray())
{
strapComp.BuckledEntities.Clear();
strapComp.OccupiedSize = 0;
- Dirty(strapComp);
+ Dirty(uid, strapComp);
}
private bool StrapHasSpace(EntityUid strapUid, BuckleComponent buckleComp, StrapComponent? strapComp = null)
strapComp.Enabled = enabled;
if (!enabled)
- StrapRemoveAll(strapComp);
+ StrapRemoveAll(strapUid, strapComp);
}
}
/// </summary>
public void AddItemSlot(EntityUid uid, string id, ItemSlot slot, ItemSlotsComponent? itemSlots = null)
{
- itemSlots ??= EntityManager.EnsureComponent<ItemSlotsComponent>(uid);
+ itemSlots ??= EnsureComp<ItemSlotsComponent>(uid);
DebugTools.AssertOwner(uid, itemSlots);
if (itemSlots.Slots.TryGetValue(id, out var existing))
slot.ContainerSlot = _containers.EnsureContainer<ContainerSlot>(uid, id);
itemSlots.Slots[id] = slot;
- Dirty(itemSlots);
+ Dirty(uid, itemSlots);
}
/// <summary>
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)
}
EnsureComp<ActiveStaminaComponent>(uid);
- Dirty(component);
+ Dirty(uid, component);
if (value <= 0)
return;
comp.NextUpdate += TimeSpan.FromSeconds(1f);
TakeStaminaDamage(uid, -comp.Decay, comp);
- Dirty(comp);
+ Dirty(uid, comp);
}
}
// Give them buffer before being able to be re-stunned
component.NextUpdate = _timing.CurTime + component.StunTime + StamCritBufferTime;
EnsureComp<ActiveStaminaComponent>(uid);
- Dirty(component);
+ Dirty(uid, component);
_adminLogger.Add(LogType.Stamina, LogImpact.Medium, $"{ToPrettyString(uid):user} entered stamina crit");
}
component.NextUpdate = _timing.CurTime;
SetStaminaAlert(uid, component);
RemComp<ActiveStaminaComponent>(uid);
- Dirty(component);
+ Dirty(uid, component);
_adminLogger.Add(LogType.Stamina, LogImpact.Low, $"{ToPrettyString(uid):user} recovered from stamina crit");
}
}
// 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<Vector2i, DecalChunk>? ChunkCollection(EntityUid gridEuid, DecalGridComponent? comp = null)
}
die.CurrentValue = (side - die.Offset) * die.Multiplier;
- Dirty(die);
+ Dirty(uid, die);
UpdateVisuals(uid, die);
}
return;
insulated.Coefficient = siemensCoefficient;
- Dirty(insulated);
+ Dirty(uid, insulated);
}
/// <param name="uid">Entity being electrocuted.</param>
if (component.Enabled == value)
return;
- Dirty(component);
+ Dirty(uid, component);
}
private void OnEmoteAttempt(EmoteAttemptEvent args)
return;
friction.Modifier = value;
- Dirty(friction);
+ Dirty(entityUid, friction);
}
}
}
return false;
component.CanFloat = GravitySystem.IsWeightless(uid, xform: transform);
- Dirty(component);
+ Dirty(uid, component);
return component.CanFloat;
}
ShakeGrid(uid, gravity);
comp.ShakeTimes--;
comp.NextShake += TimeSpan.FromSeconds(ShakeCooldown);
- Dirty(comp);
+ Dirty(uid, comp);
}
}
}
}
shake.ShakeTimes = 10;
- Dirty(shake);
+ Dirty(uid, shake);
}
protected virtual void ShakeGrid(EntityUid uid, GravityComponent? comp = null) {}
}
if (dirty)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
protected virtual void SetLayerVisibility(
humanoid.MarkingSet = new(oldMarkings, prototype.MarkingPoints, _markingManager, _prototypeManager);
if (sync)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
humanoid.SkinColor = skinColor;
if (sync)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
humanoid.CustomBaseLayers[layer] = new(id);
if (sync)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
humanoid.CustomBaseLayers[layer] = new(null, color);
if (sync)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
if (sync)
{
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
}
humanoid.Age = profile.Age;
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
/// <summary>
humanoid.MarkingSet.AddBack(prototype.MarkingCategory, markingObject);
if (sync)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
private void EnsureDefaultMarkings(EntityUid uid, HumanoidAppearanceComponent? humanoid)
humanoid.MarkingSet.AddBack(prototype.MarkingCategory, markingObject);
if (sync)
- Dirty(humanoid);
+ Dirty(uid, humanoid);
}
}
var ev = new TransferDnaEvent { Donor = target, Recipient = implanter };
RaiseLocalEvent(target, ref ev);
- Dirty(component);
+ Dirty(implanter, component);
}
public bool CanImplant(
if (component.CurrentMode == ImplanterToggleMode.Draw && !component.ImplantOnly && !permanentFound)
ImplantMode(implanter, component);
- Dirty(component);
+ Dirty(implanter, component);
}
}
{
}
- 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);
}
}
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)
args.State = new RgbLightControllerState(component.CycleRate, component.Layers);
}
- public void SetLayers(EntityUid uid, List<int>? layers, RgbLightControllerComponent? rgb = null)
+ public void SetLayers(EntityUid uid, List<int>? 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)
return;
rgb.CycleRate = Math.Clamp(0.01f, rate, 1); // lets not give people seizures
- Dirty(rgb);
+ Dirty(uid, rgb);
}
}
if (_net.IsServer)
_popup.PopupEntity(popupString, uid);
- Dirty(component);
+ Dirty(uid, component);
}
/// <summary>
return false;
component.Energy = FixedPoint2.Clamp(component.Energy + delta, 0, component.MaxEnergy);
- Dirty(component);
+ Dirty(uid, component);
UpdateUserInterface(uid, component);
return true;
}
UpdateAppearance(uid, component);
}
- Dirty(component);
+ Dirty(uid, component);
UpdateUserInterface(uid, component);
}
}
component.WalkSpeedModifier = walkSpeed;
component.SprintSpeedModifier = sprintSpeed;
- Dirty(component);
+ Dirty(uid, component);
_toUpdate.UnionWith(_physics.GetContactingEntities(uid));
}
component.Thresholds[HungerThreshold.Dead],
component.Thresholds[HungerThreshold.Overfed]);
UpdateCurrentThreshold(uid, component);
- Dirty(component);
+ Dirty(uid, component);
}
private void UpdateCurrentThreshold(EntityUid uid, HungerComponent? component = null)
return;
component.CurrentThreshold = calculatedHungerThreshold;
DoHungerThresholdEffects(uid, component);
- Dirty(component);
+ Dirty(uid, component);
}
private void DoHungerThresholdEffects(EntityUid uid, HungerComponent? component = null, bool force = false)
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)
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<RCDComponent>(target) ||
!TryComp<LimitedChargesComponent>(target, out var charges))
return;
_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)
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);
return;
eventHorizon.Radius = value;
- Dirty(eventHorizon);
+ Dirty(uid, eventHorizon);
if (updateFixture)
UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon);
}
return;
eventHorizon.CanBreachContainment = value;
- Dirty(eventHorizon);
+ Dirty(uid, eventHorizon);
if (updateFixture)
UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon);
}
return;
eventHorizon.ColliderFixtureId = value;
- Dirty(eventHorizon);
+ Dirty(uid, eventHorizon);
if (updateFixture)
UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon);
}
return;
eventHorizon.ConsumerFixtureId = value;
- Dirty(eventHorizon);
+ Dirty(uid, eventHorizon);
if (updateFixture)
UpdateEventHorizonFixture(uid, eventHorizon: eventHorizon);
}
[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!;
// 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));
return false;
standingState.Standing = false;
- Dirty(standingState);
+ Dirty(uid, standingState);
RaiseLocalEvent(uid, new DownedEvent(), false);
// Seemed like the best place to put it
var key = keyStorage.Key;
keyStorage.Key = null;
- Dirty(keyStorage);
+ Dirty(uid, keyStorage);
return key;
}
_alertsSystem.ShowAlert(uid, proto.Alert.Value, null, cooldown1);
}
- Dirty(status);
+ Dirty(uid, status);
RaiseLocalEvent(uid, new StatusEffectAddedEvent(uid, key));
return true;
}
RemComp<ActiveStatusEffectsComponent>(uid);
}
- Dirty(status);
+ Dirty(uid, status);
RaiseLocalEvent(uid, new StatusEffectEndedEvent(uid, key));
return true;
}
failed = true;
}
- Dirty(status);
+ Dirty(uid, status);
return failed;
}
_alertsSystem.ShowAlert(uid, proto.Alert.Value, null, cooldown);
}
- Dirty(status);
+ Dirty(uid, status);
return true;
}
_alertsSystem.ShowAlert(uid, proto.Alert.Value, null, cooldown);
}
- Dirty(status);
+ Dirty(uid, status);
return true;
}
status.ActiveEffects[key].Cooldown = (_gameTiming.CurTime, _gameTiming.CurTime + time);
- Dirty(status);
+ Dirty(uid, status);
return true;
}
_container.Insert(toInsert, component.ItemContainer);
component.Items.Add(toInsert);
- Dirty(component);
+ Dirty(uid, component);
return true;
}
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())
return false;
component.Items.Remove(toRemove.Value);
- Dirty(component);
+ Dirty(uid, component);
return true;
}
}
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;
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;
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;
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;
}
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
/// </exception>
public bool AddTag(EntityUid entity, string id)
{
- return AddTag(EnsureComp<TagComponent>(entity), id);
+ return AddTag(entity, EnsureComp<TagComponent>(entity), id);
}
/// <summary>
/// </exception>
public bool AddTags(EntityUid entity, params string[] ids)
{
- return AddTags(EnsureComp<TagComponent>(entity), ids);
+ return AddTags(entity, EnsureComp<TagComponent>(entity), ids);
}
/// <summary>
/// </exception>
public bool AddTags(EntityUid entity, IEnumerable<string> ids)
{
- return AddTags(EnsureComp<TagComponent>(entity), ids);
+ return AddTags(entity, EnsureComp<TagComponent>(entity), ids);
}
/// <summary>
public bool TryAddTag(EntityUid entity, string id)
{
return TryComp<TagComponent>(entity, out var component) &&
- AddTag(component, id);
+ AddTag(entity, component, id);
}
/// <summary>
public bool TryAddTags(EntityUid entity, params string[] ids)
{
return TryComp<TagComponent>(entity, out var component) &&
- AddTags(component, ids);
+ AddTags(entity, component, ids);
}
/// <summary>
public bool TryAddTags(EntityUid entity, IEnumerable<string> ids)
{
return TryComp<TagComponent>(entity, out var component) &&
- AddTags(component, ids);
+ AddTags(entity, component, ids);
}
/// <summary>
public bool RemoveTag(EntityUid entity, string id)
{
return TryComp<TagComponent>(entity, out var component) &&
- RemoveTag(component, id);
+ RemoveTag(entity, component, id);
}
/// <summary>
public bool RemoveTags(EntityUid entity, params string[] ids)
{
return TryComp<TagComponent>(entity, out var component) &&
- RemoveTags(component, ids);
+ RemoveTags(entity, component, ids);
}
/// <summary>
public bool RemoveTags(EntityUid entity, IEnumerable<string> ids)
{
return TryComp<TagComponent>(entity, out var component) &&
- RemoveTags(component, ids);
+ RemoveTags(entity, component, ids);
}
/// <summary>
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- 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;
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- 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());
}
/// <summary>
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool AddTags(TagComponent component, IEnumerable<string> ids)
+ public bool AddTags(EntityUid uid, TagComponent component, IEnumerable<string> ids)
{
var count = component.Tags.Count;
if (component.Tags.Count > count)
{
- Dirty(component);
+ Dirty(uid, component);
return true;
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- 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;
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- 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());
}
/// <summary>
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool RemoveTags(TagComponent component, IEnumerable<string> ids)
+ public bool RemoveTags(EntityUid uid, TagComponent component, IEnumerable<string> ids)
{
var count = component.Tags.Count;
if (component.Tags.Count < count)
{
- Dirty(component);
+ Dirty(uid, component);
return true;
}
/// <param name="secondLink">Resolve comp</param>
/// <returns>Whether unlinking was successful (e.g. they both were actually linked to one another)</returns>
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;
_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);
marker.Marker = projectile.Weapon.Value;
marker.EndTime = _timing.CurTime + component.Duration;
component.Amount--;
- Dirty(marker);
+ Dirty(args.OtherEntity, marker);
if (_netManager.IsServer)
{
}
else
{
- Dirty(component);
+ Dirty(uid, component);
}
}
}
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";
RemComp<TetheredComponent>(component.Tethered.Value);
_blocker.UpdateCanMove(component.Tethered.Value);
component.Tethered = null;
- Dirty(component);
+ Dirty(gunUid, component);
}
[Serializable, NetSerializable]
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)
if (recharge.NextCharge == null || recharge.NextCharge < _timing.CurTime)
{
recharge.NextCharge = _timing.CurTime + TimeSpan.FromSeconds(recharge.RechargeCooldown);
- Dirty(recharge);
+ Dirty(uid, recharge);
}
}
}
return;
_gun.UpdateBasicEntityAmmoCount(uid, basic.Count.Value + 1, basic);
- Dirty(basic);
+ Dirty(uid, basic);
args.Handled = true;
}
}
if (melee.NextAttack > component.NextFire)
{
component.NextFire = melee.NextAttack;
- Dirty(component);
+ Dirty(uid, component);
}
}
[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<BlockWeatherComponent> _blockQuery;
// Shutting down
if (endTime != null && remainingTime < WeatherComponent.ShutdownTime)
{
- SetState(WeatherState.Ending, comp, weather, weatherProto);
+ SetState(uid, WeatherState.Ending, comp, weather, weatherProto);
}
// Starting up
else
if (elapsed < WeatherComponent.StartupTime)
{
- SetState(WeatherState.Starting, comp, weather, weatherProto);
+ SetState(uid, WeatherState.Starting, comp, weather, weatherProto);
}
}
}
if (proto != null)
- StartWeather(weatherComp, proto, endTime);
+ StartWeather(mapUid, weatherComp, proto, endTime);
}
/// <summary>
/// Run every tick when the weather is running.
/// </summary>
- 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;
};
component.Weather.Add(weather.ID, data);
- Dirty(component);
+ Dirty(uid, component);
}
protected virtual void EndWeather(EntityUid uid, WeatherComponent component, string proto)
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;
}