Fixes JSON WorldConverter (#263)
- [X] Adds Map index support for JSON MapConverter - [X] Files JSON WorldConverter - [X] Removes LINQ for Map.Parse Bumps release version
This commit is contained in:
parent
13e2693b59
commit
93cf40ec81
7 changed files with 73 additions and 54 deletions
|
|
@ -404,10 +404,28 @@ namespace Server
|
|||
|
||||
if (!int.TryParse(value, out var index))
|
||||
{
|
||||
return Maps.FirstOrDefault(m => m != null && Insensitive.Equals(m.Name, value));
|
||||
index = -1;
|
||||
}
|
||||
else if (index == 127)
|
||||
{
|
||||
return Internal;
|
||||
}
|
||||
|
||||
return index == 127 ? Internal : Maps.FirstOrDefault(m => m?.MapIndex == index);
|
||||
for (int i = 0; i < Maps.Length; i++)
|
||||
{
|
||||
var map = Maps[i];
|
||||
if (map == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (index >= 0 && map.MapIndex == index || Insensitive.Equals(map.Name, value))
|
||||
{
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override string ToString() => Name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue