Clear cached NPC factions on refresh (#14762)
This commit is contained in:
@@ -36,6 +36,9 @@ namespace Content.Server.NPC.Systems
|
|||||||
|
|
||||||
private void OnProtoReload(PrototypesReloadedEventArgs obj)
|
private void OnProtoReload(PrototypesReloadedEventArgs obj)
|
||||||
{
|
{
|
||||||
|
if (!obj.ByType.ContainsKey(typeof(FactionPrototype)))
|
||||||
|
return;
|
||||||
|
|
||||||
RefreshFactions();
|
RefreshFactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +52,9 @@ namespace Content.Server.NPC.Systems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void RefreshFactions(FactionComponent component)
|
private void RefreshFactions(FactionComponent component)
|
||||||
{
|
{
|
||||||
|
component.FriendlyFactions.Clear();
|
||||||
|
component.HostileFactions.Clear();
|
||||||
|
|
||||||
foreach (var faction in component.Factions)
|
foreach (var faction in component.Factions)
|
||||||
{
|
{
|
||||||
// YAML Linter already yells about this
|
// YAML Linter already yells about this
|
||||||
|
|||||||
Reference in New Issue
Block a user