]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
rmobjective fix (#15850)
authorvanx <61917534+Vaaankas@users.noreply.github.com>
Sat, 29 Apr 2023 08:26:47 +0000 (15:26 +0700)
committerGitHub <noreply@github.com>
Sat, 29 Apr 2023 08:26:47 +0000 (18:26 +1000)
Co-authored-by: vanx <vanx#5477>
Content.Server/Mind/Mind.cs
Content.Server/Objectives/Commands/ListObjectivesCommand.cs

index c022300b89123290bfcecc294eed49cf70921874..4407a1b2cddce30659b22e84f51299f14dc7b16b 100644 (file)
@@ -289,12 +289,12 @@ namespace Content.Server.Mind
         }
 
         /// <summary>
-        /// Removes an objective to this mind.
+        /// Removes an objective from this mind.
         /// </summary>
         /// <returns>Returns true if the removal succeeded.</returns>
         public bool TryRemoveObjective(int index)
         {
-            if (_objectives.Count >= index) return false;
+            if (index < 0 || index >= _objectives.Count) return false;
 
             var objective = _objectives[index];
 
index a2c7851bb0e40962392a12c975c4b027f65eac45..d4bdf2fd2959f39eed633dd8d05321a8bbd2fdf4 100644 (file)
@@ -42,7 +42,7 @@ namespace Content.Server.Objectives.Commands
             }
             for (var i = 0; i < objectives.Count; i++)
             {
-                shell.WriteLine($"- [{i + 1}] {objectives[i].Conditions[0].Title}");
+                shell.WriteLine($"- [{i}] {objectives[i].Conditions[0].Title}");
             }
 
         }