Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr committed Dec 23, 2024
1 parent 0de702b commit 164cb1a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Robust.Shared/EntitySerialization/EntitySerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ public DataNode Write(
goto case MissingEntityBehaviour.AutoIncludeChildren;
case MissingEntityBehaviour.AutoInclude:
case MissingEntityBehaviour.AutoIncludeChildren:
if (Options.WarnOnAutoInclude)
_log.Warning($"Auto-including entity {EntMan.ToPrettyString(value)} referenced by {EntMan.ToPrettyString(CurrentEntity)}");
if (Options.LogAutoInclude is {} level)
_log.Log(level, $"Auto-including entity {EntMan.ToPrettyString(value)} referenced by {EntMan.ToPrettyString(CurrentEntity)}");
_autoInclude.Add(value);
var id = GetYamlUid(value);
return new ValueDataNode(id.ToString(CultureInfo.InvariantCulture));
Expand Down
2 changes: 0 additions & 2 deletions Robust.Shared/EntitySerialization/LoadResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,4 @@ public sealed class LoadResult
/// <see cref="MapComponent"/>, and were not listed as orphans
/// </summary>
public readonly List<EntityUid> NullspaceEntities = new();


}
6 changes: 4 additions & 2 deletions Robust.Shared/EntitySerialization/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using JetBrains.Annotations;
using Robust.Shared.EntitySerialization.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Maths;

Expand All @@ -25,9 +26,10 @@ public record struct SerializationOptions
public bool ErrorOnOrphan = true;

/// <summary>
/// Whether or not to log a warning when auto-including entities while serializing. See <see cref="MissingEntityBehaviour"/>.
/// Log level to use when auto-including entities while serializing. Null implies no logs.
/// See <see cref="MissingEntityBehaviour"/>.
/// </summary>
public bool WarnOnAutoInclude = true;
public LogLevel? LogAutoInclude = LogLevel.Info;

/// <summary>
/// If true, the serializer will log an error if it encounters a post map-init entity.
Expand Down
2 changes: 1 addition & 1 deletion Robust.Shared/EntitySerialization/SerializationEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public enum FileCategory : byte
Map,

/// <summary>
/// File is a full game save, and will in general contain one or more maps likely a few null-space entities.
/// File is a full game save, and will likely contain at least one map and a few null-space entities.
/// </summary>
/// <remarks>
/// The file might also contain additional yaml entries for things like prototypes uploaded via
Expand Down
2 changes: 1 addition & 1 deletion Robust.Shared/GameObjects/EntityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public virtual void FrameUpdate(float frameTime)

#region Entity Management

[Obsolete]
/// <inheritdoc />
public EntityUid CreateEntityUninitialized(string? prototypeName, EntityUid euid, ComponentRegistry? overrides = null)
{
return CreateEntity(prototypeName, out _, overrides);
Expand Down

0 comments on commit 164cb1a

Please sign in to comment.