mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-06-09 10:06:43 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user