Cleanup remaining IMapManager.MapExists uses (#37851)

Cleanup remaining IMapManager.MapExists uses
This commit is contained in:
Tayrtahn
2025-05-26 12:45:55 -04:00
committed by GitHub
parent df2c2adc9d
commit 24dd207b4f
5 changed files with 14 additions and 14 deletions

View File

@@ -9,17 +9,17 @@ using Robust.Shared.Utility;
namespace Content.Server.Administration.Commands; namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Server)] [AdminCommand(AdminFlags.Server)]
public sealed class PersistenceSave : IConsoleCommand public sealed class PersistenceSave : LocalizedEntityCommands
{ {
[Dependency] private readonly IConfigurationManager _config = default!; [Dependency] private readonly IConfigurationManager _config = default!;
[Dependency] private readonly IEntitySystemManager _system = default!; [Dependency] private readonly IEntitySystemManager _system = default!;
[Dependency] private readonly IMapManager _map = default!; [Dependency] private readonly SharedMapSystem _map = default!;
public string Command => "persistencesave"; public override string Command => "persistencesave";
public string Description => "Saves server data to a persistence file to be loaded later."; public override string Description => "Saves server data to a persistence file to be loaded later.";
public string Help => "persistencesave [mapId] [filePath - default: game.map (CCVar) ]"; public override string Help => "persistencesave [mapId] [filePath - default: game.map (CCVar) ]";
public void Execute(IConsoleShell shell, string argStr, string[] args) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
if (args.Length < 1 || args.Length > 2) if (args.Length < 1 || args.Length > 2)
{ {

View File

@@ -90,7 +90,7 @@ namespace Content.Server.GameTicking
/// </remarks> /// </remarks>
private void LoadMaps() private void LoadMaps()
{ {
if (_mapManager.MapExists(DefaultMap)) if (_map.MapExists(DefaultMap))
return; return;
AddGamePresetRules(); AddGamePresetRules();
@@ -208,7 +208,7 @@ namespace Content.Server.GameTicking
} }
_metaData.SetEntityName(mapUid, proto.MapName); _metaData.SetEntityName(mapUid, proto.MapName);
var g = new List<EntityUid> {grid.Value.Owner}; var g = new List<EntityUid> { grid.Value.Owner };
RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName)); RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName));
return g; return g;
} }
@@ -258,7 +258,7 @@ namespace Content.Server.GameTicking
} }
_metaData.SetEntityName(mapUid, proto.MapName); _metaData.SetEntityName(mapUid, proto.MapName);
var g = new List<EntityUid> {grid.Value.Owner}; var g = new List<EntityUid> { grid.Value.Owner };
RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName)); RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName));
return g; return g;
} }
@@ -308,7 +308,7 @@ namespace Content.Server.GameTicking
throw new Exception($"Failed to load game-map grid {ev.GameMap.ID}"); throw new Exception($"Failed to load game-map grid {ev.GameMap.ID}");
} }
var g = new List<EntityUid> {grid.Value.Owner}; var g = new List<EntityUid> { grid.Value.Owner };
// TODO MAP LOADING use a new event? // TODO MAP LOADING use a new event?
RaiseLocalEvent(new PostGameMapLoad(proto, targetMap, g, stationName)); RaiseLocalEvent(new PostGameMapLoad(proto, targetMap, g, stationName));
return g; return g;
@@ -390,7 +390,7 @@ namespace Content.Server.GameTicking
HumanoidCharacterProfile profile; HumanoidCharacterProfile profile;
if (_prefsManager.TryGetCachedPreferences(userId, out var preferences)) if (_prefsManager.TryGetCachedPreferences(userId, out var preferences))
{ {
profile = (HumanoidCharacterProfile) preferences.SelectedCharacter; profile = (HumanoidCharacterProfile)preferences.SelectedCharacter;
} }
else else
{ {

View File

@@ -43,7 +43,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
var mapId = new MapId(mapInt); var mapId = new MapId(mapInt);
if (!MapManager.MapExists(mapId)) if (!_mapSystem.MapExists(mapId))
return; return;
if (!_mapSystem.TryGetMap(mapId, out var mapUid)) if (!_mapSystem.TryGetMap(mapId, out var mapUid))

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Explosion.Components;
/// <summary> /// <summary>
/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. <see cref="OnUseTimerTriggerComponent"/>. /// Component for tracking active trigger timers. A timers can activated by some other component, e.g. <see cref="OnUseTimerTriggerComponent"/>.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent]
public sealed partial class ActiveTimerTriggerComponent : Component public sealed partial class ActiveTimerTriggerComponent : Component
{ {
[DataField] public float TimeRemaining; [DataField] public float TimeRemaining;

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.StoreDiscount.Components;
/// <summary> /// <summary>
/// Partner-component for adding discounts functionality to StoreSystem using StoreDiscountSystem. /// Partner-component for adding discounts functionality to StoreSystem using StoreDiscountSystem.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent]
public sealed partial class StoreDiscountComponent : Component public sealed partial class StoreDiscountComponent : Component
{ {
/// <summary> /// <summary>