From 4c7a3b34fe3f6adbb9ea195845a18ca620401f74 Mon Sep 17 00:00:00 2001 From: Regalis Date: Tue, 30 May 2017 19:26:12 +0300 Subject: [PATCH] Console commands can be used on characters whose name is a number (FindMatchingCharacter method interpreted the name parameter as an index) --- Subsurface/Source/DebugConsole.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Subsurface/Source/DebugConsole.cs b/Subsurface/Source/DebugConsole.cs index cb6c83ada..9e117a51d 100644 --- a/Subsurface/Source/DebugConsole.cs +++ b/Subsurface/Source/DebugConsole.cs @@ -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(); }