remove a bunch of redundant IsFirstTimePredicted checks (#41119)

This commit is contained in:
slarticodefast
2025-10-26 13:59:52 +01:00
committed by GitHub
parent d1f159d31b
commit d212f3cdae
6 changed files with 2 additions and 25 deletions

View File

@@ -73,9 +73,6 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
/// <param name="frameTime">The time elapsed since the last set of updates.</param> /// <param name="frameTime">The time elapsed since the last set of updates.</param>
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
if(!_timing.IsFirstTimePredicted)
return;
var query = EntityQueryEnumerator<GravityWellComponent, TransformComponent>(); var query = EntityQueryEnumerator<GravityWellComponent, TransformComponent>();
while (query.MoveNext(out var uid, out var gravWell, out var xform)) while (query.MoveNext(out var uid, out var gravWell, out var xform))
{ {

View File

@@ -36,9 +36,6 @@ public sealed class SingularityAttractorSystem : EntitySystem
/// <param name="frameTime">The time elapsed since the last set of updates.</param> /// <param name="frameTime">The time elapsed since the last set of updates.</param>
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
if (!_timing.IsFirstTimePredicted)
return;
var query = EntityQueryEnumerator<SingularityAttractorComponent, TransformComponent>(); var query = EntityQueryEnumerator<SingularityAttractorComponent, TransformComponent>();
var now = _timing.CurTime; var now = _timing.CurTime;
while (query.MoveNext(out var uid, out var attractor, out var xform)) while (query.MoveNext(out var uid, out var attractor, out var xform))

View File

@@ -5,11 +5,8 @@ using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems; using Content.Shared.Singularity.EntitySystems;
using Content.Shared.Singularity.Events; using Content.Shared.Singularity.Events;
using Robust.Server.GameStates; using Robust.Server.GameStates;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Timing;
namespace Content.Server.Singularity.EntitySystems; namespace Content.Server.Singularity.EntitySystems;
@@ -22,7 +19,6 @@ namespace Content.Server.Singularity.EntitySystems;
public sealed class SingularitySystem : SharedSingularitySystem public sealed class SingularitySystem : SharedSingularitySystem
{ {
#region Dependencies #region Dependencies
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly PvsOverrideSystem _pvs = default!; [Dependency] private readonly PvsOverrideSystem _pvs = default!;
#endregion Dependencies #endregion Dependencies
@@ -70,9 +66,6 @@ public sealed class SingularitySystem : SharedSingularitySystem
/// <param name="frameTime">The amount of time since the last set of updates.</param> /// <param name="frameTime">The amount of time since the last set of updates.</param>
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
if(!_timing.IsFirstTimePredicted)
return;
var query = EntityQueryEnumerator<SingularityComponent>(); var query = EntityQueryEnumerator<SingularityComponent>();
while (query.MoveNext(out var uid, out var singularity)) while (query.MoveNext(out var uid, out var singularity))
{ {

View File

@@ -4,15 +4,13 @@ using Content.Shared.Body.Events;
using Content.Shared.Zombies; using Content.Shared.Zombies;
using Content.Server.Zombies; using Content.Server.Zombies;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
namespace Content.Server.Species.Systems; namespace Content.Server.Species.Systems;
public sealed partial class NymphSystem : EntitySystem public sealed partial class NymphSystem : EntitySystem
{ {
[Dependency] private readonly IPrototypeManager _protoManager= default!; [Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly MindSystem _mindSystem = default!; [Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly ZombieSystem _zombie = default!; [Dependency] private readonly ZombieSystem _zombie = default!;
public override void Initialize() public override void Initialize()
@@ -24,9 +22,6 @@ public sealed partial class NymphSystem : EntitySystem
private void OnRemovedFromPart(EntityUid uid, NymphComponent comp, ref OrganRemovedFromBodyEvent args) private void OnRemovedFromPart(EntityUid uid, NymphComponent comp, ref OrganRemovedFromBodyEvent args)
{ {
if (!_timing.IsFirstTimePredicted)
return;
if (TerminatingOrDeleted(uid) || TerminatingOrDeleted(args.OldBody)) if (TerminatingOrDeleted(uid) || TerminatingOrDeleted(args.OldBody))
return; return;

View File

@@ -25,9 +25,6 @@ public sealed class XAEPortalSystem : BaseXAESystem<XAEPortalComponent>
/// <inheritdoc /> /// <inheritdoc />
protected override void OnActivated(Entity<XAEPortalComponent> ent, ref XenoArtifactNodeActivatedEvent args) protected override void OnActivated(Entity<XAEPortalComponent> ent, ref XenoArtifactNodeActivatedEvent args)
{ {
if (!_timing.IsFirstTimePredicted)
return;
var map = Transform(ent).MapID; var map = Transform(ent).MapID;
var validMinds = new ValueList<EntityUid>(); var validMinds = new ValueList<EntityUid>();
var mindQuery = EntityQueryEnumerator<MindContainerComponent, MobStateComponent, TransformComponent, MetaDataComponent>(); var mindQuery = EntityQueryEnumerator<MindContainerComponent, MobStateComponent, TransformComponent, MetaDataComponent>();

View File

@@ -16,7 +16,6 @@ using Content.Shared.Whitelist;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
namespace Content.Shared.Inventory; namespace Content.Shared.Inventory;
@@ -31,7 +30,6 @@ public abstract partial class InventorySystem
[Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly SharedStrippableSystem _strippable = default!; [Dependency] private readonly SharedStrippableSystem _strippable = default!;
@@ -468,7 +466,7 @@ public abstract partial class InventorySystem
// we check if any items were dropped, and make a popup if they were. // we check if any items were dropped, and make a popup if they were.
// the reason we check for > 1 is because the first item is always the one we are trying to unequip, // the reason we check for > 1 is because the first item is always the one we are trying to unequip,
// whereas we only want to notify for extra dropped items. // whereas we only want to notify for extra dropped items.
if (!silent && _gameTiming.IsFirstTimePredicted && firstRun && itemsDropped > 1) if (!silent && firstRun && itemsDropped > 1)
_popup.PopupClient(Loc.GetString("inventory-component-dropped-from-unequip", ("items", itemsDropped - 1)), target, target); _popup.PopupClient(Loc.GetString("inventory-component-dropped-from-unequip", ("items", itemsDropped - 1)), target, target);
// TODO: Inventory needs a hot cleanup hoo boy // TODO: Inventory needs a hot cleanup hoo boy