Cleanup all instances of IMapManager.GetMapEntityId (#37814)
* Cleanup all instances of IMapManager.GetMapEntityId * Dependencies * LocalizedEntityCommands
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user