fix(core): Fixes region base type (#635)

Fixes `Region` being loaded instead of `BaseRegion` as the default region type.
This commit is contained in:
Kamron Batman 2021-06-02 23:12:52 -07:00 committed by GitHub
parent 803b4a33cb
commit cc5a8dc4fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 211 additions and 190 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using Server.Buffers;
using Server.Gumps;
using Server.Json;
using Server.Mobiles;
@ -31,12 +32,12 @@ namespace Server.Regions
public BaseRegion(DynamicJson json, JsonSerializerOptions options) : base(json, options)
{
if (json.data.TryGetValue("rune", out var runeName))
if (json.GetProperty<string>("rune", options, out var runeName))
{
RuneName = runeName.GetString();
RuneName = runeName;
}
NoLogoutDelay = json.data.TryGetValue("logoutDelay", out var logoutDelay) && !logoutDelay.GetBoolean();
NoLogoutDelay = json.GetProperty<bool>("logoutDelay", options, out var logoutDelay) && !logoutDelay;
}
public bool ExcludeFromParentSpawns { get; set; }
@ -56,11 +57,6 @@ namespace Server.Regions
public bool NoLogoutDelay { get; set; }
public static void Configure()
{
DefaultRegionType = typeof(BaseRegion);
}
public static string GetRuneNameFor(Region region)
{
while (region != null)