Clear cached NPC factions on refresh (#14762)

This commit is contained in:
metalgearsloth
2023-03-22 15:58:23 +11:00
committed by GitHub
parent 0936f43d9e
commit 4151b31b31

View File

@@ -36,6 +36,9 @@ namespace Content.Server.NPC.Systems
private void OnProtoReload(PrototypesReloadedEventArgs obj)
{
if (!obj.ByType.ContainsKey(typeof(FactionPrototype)))
return;
RefreshFactions();
}
@@ -49,6 +52,9 @@ namespace Content.Server.NPC.Systems
/// </summary>
private void RefreshFactions(FactionComponent component)
{
component.FriendlyFactions.Clear();
component.HostileFactions.Clear();
foreach (var faction in component.Factions)
{
// YAML Linter already yells about this