Log all broken reactions.
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.Maps;
|
using Content.Shared.Maps;
|
||||||
using Robust.Shared.ContentPack;
|
using Robust.Shared.ContentPack;
|
||||||
using Robust.Shared.Interfaces.Map;
|
using Robust.Shared.Interfaces.Map;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Localization.Macros;
|
using Robust.Shared.Localization.Macros;
|
||||||
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Shared
|
namespace Content.Shared
|
||||||
@@ -39,6 +41,33 @@
|
|||||||
base.PostInit();
|
base.PostInit();
|
||||||
|
|
||||||
_initTileDefinitions();
|
_initTileDefinitions();
|
||||||
|
CheckReactions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckReactions()
|
||||||
|
{
|
||||||
|
foreach (var reaction in _prototypeManager.EnumeratePrototypes<ReactionPrototype>())
|
||||||
|
{
|
||||||
|
foreach (var reactant in reaction.Reactants.Keys)
|
||||||
|
{
|
||||||
|
if (!_prototypeManager.HasIndex<ReagentPrototype>(reactant))
|
||||||
|
{
|
||||||
|
Logger.ErrorS(
|
||||||
|
"chem", "Reaction {reaction} has unknown reactant {reagent}.",
|
||||||
|
reaction.ID, reactant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var product in reaction.Products.Keys)
|
||||||
|
{
|
||||||
|
if (!_prototypeManager.HasIndex<ReagentPrototype>(product))
|
||||||
|
{
|
||||||
|
Logger.ErrorS(
|
||||||
|
"chem", "Reaction {reaction} has unknown product {product}.",
|
||||||
|
reaction.ID, product);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _initTileDefinitions()
|
private void _initTileDefinitions()
|
||||||
@@ -55,6 +84,7 @@
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
prototypeList.Add(tileDef);
|
prototypeList.Add(tileDef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user