improve mag command matching of maps and gametypes
This commit is contained in:
parent
2e531c4a50
commit
d527a86911
@ -54,20 +54,8 @@ namespace IW4MAdmin.Application.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string map;
|
var map = match.Groups[1].Length > 0 ? match.Groups[1].ToString() : match.Groups[2].ToString();
|
||||||
string gametype;
|
var gametype = match.Groups[3].Length > 0 ? match.Groups[3].ToString() : match.Groups[4].ToString();
|
||||||
|
|
||||||
if (match.Groups.Count > 3)
|
|
||||||
{
|
|
||||||
map = match.Groups[2].ToString();
|
|
||||||
gametype = match.Groups[4].ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
map = match.Groups[1].ToString();
|
|
||||||
gametype = match.Groups[3].ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
var matchingMaps = gameEvent.Owner.FindMap(map);
|
var matchingMaps = gameEvent.Owner.FindMap(map);
|
||||||
var matchingGametypes = _defaultSettings.FindGametype(gametype, gameEvent.Owner.GameName);
|
var matchingGametypes = _defaultSettings.FindGametype(gametype, gameEvent.Owner.GameName);
|
||||||
|
Loading…
Reference in New Issue
Block a user