Console commands can be used on characters whose name is a number (FindMatchingCharacter method interpreted the name parameter as an index)

This commit is contained in:
Regalis
2017-05-30 19:26:12 +03:00
parent 4651e666bf
commit 4c7a3b34fe

View File

@@ -850,7 +850,7 @@ namespace Barotrauma
int characterIndex;
string characterName;
if (int.TryParse(commands.Last(), out characterIndex))
if (int.TryParse(commands.Last(), out characterIndex) && commands.Length > 2)
{
characterName = string.Join(" ", commands.Skip(1).Take(commands.Length - 2)).ToLowerInvariant();
}