Cleanup all instances of IMapManager.GetMapEntityId (#37814)

* Cleanup all instances of IMapManager.GetMapEntityId

* Dependencies

* LocalizedEntityCommands
This commit is contained in:
Tayrtahn
2025-05-25 13:09:47 -04:00
committed by GitHub
parent e08a7f3c84
commit 50fb48de2e
8 changed files with 39 additions and 41 deletions

View File

@@ -22,6 +22,7 @@ public sealed class ProjectileAnomalySystem : EntitySystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly GunSystem _gunSystem = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
public override void Initialize()
{
@@ -41,7 +42,7 @@ public sealed class ProjectileAnomalySystem : EntitySystem
private void ShootProjectilesAtEntities(EntityUid uid, ProjectileAnomalyComponent component, float severity)
{
var projectileCount = (int) MathF.Round(MathHelper.Lerp(component.MinProjectiles, component.MaxProjectiles, severity));
var projectileCount = (int)MathF.Round(MathHelper.Lerp(component.MinProjectiles, component.MaxProjectiles, severity));
var xformQuery = GetEntityQuery<TransformComponent>();
var mobQuery = GetEntityQuery<MobStateComponent>();
var xform = xformQuery.GetComponent(uid);
@@ -85,7 +86,7 @@ public sealed class ProjectileAnomalySystem : EntitySystem
var spawnCoords = _mapManager.TryFindGridAt(mapPos, out var gridUid, out _)
? _xform.WithEntityId(coords, gridUid)
: new(_mapManager.GetMapEntityId(mapPos.MapId), mapPos.Position);
: new(_map.GetMapOrInvalid(mapPos.MapId), mapPos.Position);
var ent = Spawn(component.ProjectilePrototype, spawnCoords);
var direction = _xform.ToMapCoordinates(targetCoords).Position - mapPos.Position;