Fix map yaml linter (#6433)

This commit is contained in:
metalgearsloth
2022-02-02 00:05:55 +11:00
committed by GitHub
parent 1803c29626
commit 434580845b
10 changed files with 30 additions and 27 deletions

View File

@@ -39,7 +39,7 @@ namespace Content.Server.Administration.Commands
{
if (int.TryParse(args[1], out var mapId))
{
var gameMapEnt = mapLoader.LoadBlueprint(new MapId(mapId), gameMap.MapPath);
var gameMapEnt = mapLoader.LoadBlueprint(new MapId(mapId), gameMap.MapPath.ToString());
if (gameMapEnt is null)
{
shell.WriteError($"Failed to create the given game map, is the path {gameMap.MapPath} correct?");

View File

@@ -89,7 +89,7 @@ namespace Content.Server.GameTicking
_pauseManager.AddUninitializedMap(toLoad);
}
_mapLoader.LoadMap(toLoad, map.MapPath);
_mapLoader.LoadMap(toLoad, map.MapPath.ToString());
var grids = _mapManager.GetAllMapGrids(toLoad).ToList();
var dict = new Dictionary<string, StationId>();

View File

@@ -5,6 +5,7 @@ using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Utility;
namespace Content.Server.Maps;
@@ -52,7 +53,7 @@ public class GameMapPrototype : IPrototype
/// Relative directory path to the given map, i.e. `Maps/saltern.yml`
/// </summary>
[DataField("mapPath", required: true)]
public string MapPath { get; } = default!;
public ResourcePath MapPath { get; } = default!;
/// <summary>
/// Controls if the map can be used as a fallback if no maps are eligible.

View File

@@ -3,6 +3,8 @@ using System.Linq;
using Content.Server.Objectives.Interfaces;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.Salvage
@@ -19,7 +21,7 @@ namespace Content.Server.Salvage
/// </summary>
[ViewVariables]
[DataField("mapPath", required: true)]
public string MapPath { get; } = default!;
public ResourcePath MapPath { get; } = default!;
/// <summary>
/// Size *from 0,0* in units of the map (used to determine if it fits)

View File

@@ -278,7 +278,7 @@ namespace Content.Server.Salvage
Report("salvage-system-announcement-spawn-no-debris-available");
return false;
}
var bp = _mapLoader.LoadBlueprint(spl.MapId, map.MapPath);
var bp = _mapLoader.LoadBlueprint(spl.MapId, map.MapPath.ToString());
if (bp == null)
{
Report("salvage-system-announcement-spawn-debris-disintegrated");

View File

@@ -82,7 +82,7 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
[DataField("ammoVelocity")]
public float Velocity { get; } = 20f;
[DataField("muzzleFlash", customTypeSerializer:typeof(ResourcePathSerializer))]
[DataField("muzzleFlash")]
public ResourcePath? MuzzleFlashSprite = new("Objects/Weapons/Guns/Projectiles/bullet_muzzle.png");
[DataField("soundCollectionEject")]