fix: Fixes enabling factions causing NPE (#1569)
This commit is contained in:
parent
d919f71149
commit
8c305261b3
2 changed files with 6 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ public class FactionSystem : GenericPersistence
|
|||
return;
|
||||
}
|
||||
|
||||
_factionSystem ??= new FactionSystem();
|
||||
_factionSystem.Register();
|
||||
Enabled = true;
|
||||
ServerConfiguration.SetSetting("factions.enabled", true);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue