fix: Fixes enabling factions causing NPE (#1569)

This commit is contained in:
Kamron Batman 2023-10-29 08:32:06 -07:00 committed by GitHub
parent d919f71149
commit 8c305261b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -42,6 +42,7 @@ public class FactionSystem : GenericPersistence
return;
}
_factionSystem ??= new FactionSystem();
_factionSystem.Register();
Enabled = true;
ServerConfiguration.SetSetting("factions.enabled", true);

View file

@ -11,6 +11,7 @@ namespace Server.Factions
public static void GenerateFactions_OnCommand(CommandEventArgs e)
{
var from = e.Mobile;
FactionSystem.Enable();
var factions = Faction.Factions;
@ -18,6 +19,7 @@ namespace Server.Factions
foreach (var faction in factions)
{
Generate(faction);
from.SendMessage($"Generated {faction}");
}
var towns = Town.Towns;
@ -25,7 +27,10 @@ namespace Server.Factions
foreach (var town in towns)
{
Generate(town);
from.SendMessage($"Generated {town}");
}
from.SendMessage("Faction generation completed.");
}
public static void Generate(Town town)