Rework Identifier Overrides to prevent showing Law Priority (#26680)
Does-The-Fix Co-authored-by: Mephisto72 <Mephisto.Respectator@proton.me>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Linq;
|
||||||
using Content.Server.GameTicking.Rules.Components;
|
using Content.Server.GameTicking.Rules.Components;
|
||||||
using Content.Server.Silicons.Laws;
|
using Content.Server.Silicons.Laws;
|
||||||
using Content.Server.Station.Components;
|
using Content.Server.Station.Components;
|
||||||
@@ -143,6 +144,24 @@ public sealed class IonStormRule : StationEventSystem<IonStormRuleComponent>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sets all unobfuscated laws' indentifier in order from highest to lowest priority
|
||||||
|
// This could technically override the Obfuscation from the code above, but it seems unlikely enough to basically never happen
|
||||||
|
int orderDeduction = -1;
|
||||||
|
|
||||||
|
for (int i = 0; i < laws.Laws.Count; i++)
|
||||||
|
{
|
||||||
|
string notNullIdentifier = laws.Laws[i].LawIdentifierOverride ?? (i - orderDeduction).ToString();
|
||||||
|
|
||||||
|
if (notNullIdentifier.Any(char.IsSymbol))
|
||||||
|
{
|
||||||
|
orderDeduction += 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
laws.Laws[i].LawIdentifierOverride = (i - orderDeduction).ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_adminLogger.Add(LogType.Mind, LogImpact.High, $"{ToPrettyString(ent):silicon} had its laws changed by an ion storm to {laws.LoggingString()}");
|
_adminLogger.Add(LogType.Mind, LogImpact.High, $"{ToPrettyString(ent):silicon} had its laws changed by an ion storm to {laws.LoggingString()}");
|
||||||
|
|
||||||
// laws unique to this silicon, dont use station laws anymore
|
// laws unique to this silicon, dont use station laws anymore
|
||||||
|
|||||||
Reference in New Issue
Block a user