fix(core): Fixes regions (#642)
This commit is contained in:
parent
20422e5f11
commit
7ddf2b1a8f
3 changed files with 4 additions and 13 deletions
|
|
@ -133,6 +133,8 @@ namespace Server
|
|||
{
|
||||
Map = json.GetProperty("map", options, out Map map) ? map : null;
|
||||
Parent = json.GetProperty("parent", options, out string parent) ? Find(parent, Map) : null;
|
||||
Name = json.GetProperty("name", options, out string name) ? name : null;
|
||||
|
||||
Dynamic = false;
|
||||
|
||||
if (Parent == null)
|
||||
|
|
@ -146,9 +148,7 @@ namespace Server
|
|||
Priority = Parent.Priority;
|
||||
}
|
||||
|
||||
Name = json.GetProperty("name", options, out string name) ? name : null;
|
||||
|
||||
Priority = json.GetProperty("priority", options, out int priority) ? priority : 0;
|
||||
Priority = json.GetProperty("priority", options, out int priority) ? priority : Priority;
|
||||
|
||||
Area = json.GetProperty("rects", options, out List<Rectangle3D> rects)
|
||||
? rects.ToArray()
|
||||
|
|
@ -230,15 +230,8 @@ namespace Server
|
|||
return 1;
|
||||
}
|
||||
|
||||
var thisPriority = Priority;
|
||||
var regPriority = reg.Priority;
|
||||
|
||||
if (thisPriority != regPriority)
|
||||
{
|
||||
return regPriority - thisPriority;
|
||||
}
|
||||
|
||||
return reg.ChildLevel - ChildLevel;
|
||||
return Priority != regPriority ? reg.Priority - Priority : reg.ChildLevel - ChildLevel;
|
||||
}
|
||||
|
||||
// This is not optimized. Use sparingly
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using Server.Buffers;
|
||||
using Server.Gumps;
|
||||
using Server.Json;
|
||||
using Server.Mobiles;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System.Text.Json;
|
|||
using Server.Json;
|
||||
using Server.Logging;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Regions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue