fix bug with additional group mapping key

This commit is contained in:
RaidMax 2021-06-03 13:21:08 -05:00
parent eff1fe237d
commit 16e1bbb1b5

View File

@ -261,10 +261,16 @@ namespace IW4MAdmin.Application.RConParsers
};
client.SetAdditionalProperty("BotGuid", networkIdString);
var additionalGroupIndex = Configuration.Status.GroupMapping[ParserRegex.GroupType.AdditionalGroup];
if (match.Values.Length > additionalGroupIndex)
if (Configuration.Status.GroupMapping.ContainsKey(ParserRegex.GroupType.AdditionalGroup))
{
client.SetAdditionalProperty("ConnectionClientId", match.Values[additionalGroupIndex]);
var additionalGroupIndex =
Configuration.Status.GroupMapping[ParserRegex.GroupType.AdditionalGroup];
if (match.Values.Length > additionalGroupIndex)
{
client.SetAdditionalProperty("ConnectionClientId", match.Values[additionalGroupIndex]);
}
}
StatusPlayers.Add(client);