From 46dc364dc86cf09a5fea17fdb26f62e49709a137 Mon Sep 17 00:00:00 2001 From: vanx <61917534+Vaaankas@users.noreply.github.com> Date: Sat, 29 Apr 2023 15:26:47 +0700 Subject: [PATCH] rmobjective fix (#15850) Co-authored-by: vanx --- Content.Server/Mind/Mind.cs | 4 ++-- Content.Server/Objectives/Commands/ListObjectivesCommand.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Server/Mind/Mind.cs b/Content.Server/Mind/Mind.cs index c022300b89..4407a1b2cd 100644 --- a/Content.Server/Mind/Mind.cs +++ b/Content.Server/Mind/Mind.cs @@ -289,12 +289,12 @@ namespace Content.Server.Mind } /// - /// Removes an objective to this mind. + /// Removes an objective from this mind. /// /// Returns true if the removal succeeded. public bool TryRemoveObjective(int index) { - if (_objectives.Count >= index) return false; + if (index < 0 || index >= _objectives.Count) return false; var objective = _objectives[index]; diff --git a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs index a2c7851bb0..d4bdf2fd29 100644 --- a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs +++ b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs @@ -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}"); } }