Cleanup: Pass in `IComponentFactory in EntityPrototype.TryGetComponent calls inside ImmovableRodRule` (#35462)

Cleanup

(cherry picked from commit 45e7891706dea63db3c6edafbedf8afbef44f531)
This commit is contained in:
Winkarst
2025-02-24 20:57:39 +03:00
committed by Spatison
parent 601a5ce227
commit 59bfbc466b

View File

@@ -3,6 +3,7 @@ using Content.Server.GameTicking.Rules.Components;
using Content.Server.ImmovableRod;
using Content.Server.StationEvents.Components;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared.GameTicking.Components;
using Content.Shared.Storage;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
@@ -25,7 +26,8 @@ public sealed class ImmovableRodRule : StationEventSystem<ImmovableRodRuleCompon
var proto = _prototypeManager.Index<EntityPrototype>(protoName);
if (proto.TryGetComponent<ImmovableRodComponent>(out var rod) && proto.TryGetComponent<TimedDespawnComponent>(out var despawn))
if (proto.TryGetComponent<ImmovableRodComponent>(out var rod, EntityManager.ComponentFactory) &&
proto.TryGetComponent<TimedDespawnComponent>(out var despawn, EntityManager.ComponentFactory))
{
if (!TryFindRandomTile(out _, out _, out _, out var targetCoords))
return;