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;
|
Map = json.GetProperty("map", options, out Map map) ? map : null;
|
||||||
Parent = json.GetProperty("parent", options, out string parent) ? Find(parent, 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;
|
Dynamic = false;
|
||||||
|
|
||||||
if (Parent == null)
|
if (Parent == null)
|
||||||
|
|
@ -146,9 +148,7 @@ namespace Server
|
||||||
Priority = Parent.Priority;
|
Priority = Parent.Priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
Name = json.GetProperty("name", options, out string name) ? name : null;
|
Priority = json.GetProperty("priority", options, out int priority) ? priority : Priority;
|
||||||
|
|
||||||
Priority = json.GetProperty("priority", options, out int priority) ? priority : 0;
|
|
||||||
|
|
||||||
Area = json.GetProperty("rects", options, out List<Rectangle3D> rects)
|
Area = json.GetProperty("rects", options, out List<Rectangle3D> rects)
|
||||||
? rects.ToArray()
|
? rects.ToArray()
|
||||||
|
|
@ -230,15 +230,8 @@ namespace Server
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
var thisPriority = Priority;
|
|
||||||
var regPriority = reg.Priority;
|
var regPriority = reg.Priority;
|
||||||
|
return Priority != regPriority ? reg.Priority - Priority : reg.ChildLevel - ChildLevel;
|
||||||
if (thisPriority != regPriority)
|
|
||||||
{
|
|
||||||
return regPriority - thisPriority;
|
|
||||||
}
|
|
||||||
|
|
||||||
return reg.ChildLevel - ChildLevel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is not optimized. Use sparingly
|
// This is not optimized. Use sparingly
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Server.Buffers;
|
|
||||||
using Server.Gumps;
|
using Server.Gumps;
|
||||||
using Server.Json;
|
using Server.Json;
|
||||||
using Server.Mobiles;
|
using Server.Mobiles;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ using System.Text.Json;
|
||||||
using Server.Json;
|
using Server.Json;
|
||||||
using Server.Logging;
|
using Server.Logging;
|
||||||
using Server.Mobiles;
|
using Server.Mobiles;
|
||||||
using Server.Network;
|
|
||||||
using Server.Utilities;
|
using Server.Utilities;
|
||||||
|
|
||||||
namespace Server.Regions
|
namespace Server.Regions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue