Log all broken reactions.
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Localization.Macros;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared
|
||||
@@ -39,6 +41,33 @@
|
||||
base.PostInit();
|
||||
|
||||
_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()
|
||||
@@ -55,6 +84,7 @@
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
prototypeList.Add(tileDef);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user