rmobjective fix (again) (#18033)

Co-authored-by: vanx <#vanxxxx>
This commit is contained in:
vanx
2023-07-15 14:55:24 +07:00
committed by GitHub
parent d2957d897b
commit c109a716e0

View File

@@ -467,7 +467,7 @@ public sealed class MindSystem : EntitySystem
/// <returns>Returns true if the removal succeeded.</returns> /// <returns>Returns true if the removal succeeded.</returns>
public bool TryRemoveObjective(Mind mind, int index) public bool TryRemoveObjective(Mind mind, int index)
{ {
if (mind.Objectives.Count >= index) return false; if (index < 0 || index >= mind.Objectives.Count) return false;
var objective = mind.Objectives[index]; var objective = mind.Objectives[index];