Fix serialization of home mount flag

Part of #6
This commit is contained in:
zontreck 2025-06-05 12:41:22 -07:00
parent bd12021575
commit ac8ac62d27
4 changed files with 16 additions and 15 deletions

View file

@ -202,10 +202,11 @@ namespace AriasServerUtils
if (args.Caller.Player is IServerPlayer isp)
{
if (args.Command.FullName == "sethomemount")
bool withMount = false;
if (args.Command.Name == "sethomemount")
{
// Check for the gears and pay here, or show error.
withMount = true;
}
bool bypass = isOp && ServerUtilities.config.AdminsBypassMaxHomes;
@ -213,16 +214,8 @@ namespace AriasServerUtils
if (bypass || data.Homes.Count < ServerUtilities.config.MaxHomes || data.Homes.ContainsKey(homeName))
{
data.Homes[homeName] = Home.MakeHome(args.Caller.Player.Entity, homeName);
data.Homes[homeName] = Home.MakeHome(args.Caller.Player.Entity, homeName, withMount: withMount);
ServerUtilities.SendMessageTo(isp, Lang.Get($"{ServerUtilities.MOD_ID}:home-set"));
if (args.Command.FullName == "sethomemount")
{
// Enable mount in the home
data.Homes[homeName].CanHaveMount = true;
}
}
else
{