Make NumberObjective Max inclusive (#44228)

* yeah

* comment

* Apply suggestion from @slarticodefast

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
ScarKy0
2026-06-03 21:03:40 +02:00
committed by GitHub
parent 34160b2eea
commit 946a516d72
2 changed files with 3 additions and 3 deletions
@@ -16,13 +16,13 @@ public sealed partial class NumberObjectiveComponent : Component
public int Target;
/// <summary>
/// Minimum number for target to roll.
/// Minimum number for target to roll. (Inclusive)
/// </summary>
[DataField(required: true)]
public int Min;
/// <summary>
/// Maximum number for target to roll.
/// Maximum number for target to roll. (Inclusive)
/// </summary>
[DataField(required: true)]
public int Max;
@@ -23,7 +23,7 @@ public sealed partial class NumberObjectiveSystem : EntitySystem
private void OnAssigned(EntityUid uid, NumberObjectiveComponent comp, ref ObjectiveAssignedEvent args)
{
comp.Target = _random.Next(comp.Min, comp.Max);
comp.Target = _random.Next(comp.Min, comp.Max + 1);
}
private void OnAfterAssign(EntityUid uid, NumberObjectiveComponent comp, ref ObjectiveAfterAssignEvent args)