Skip to content

Commit

Permalink
index out of bounds fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EzioTheDeadPoet committed Jun 16, 2021
1 parent 89b078c commit 430cc42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion HalgarisRPGLoot/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class Extensions

public static T RandomItem<T>(this T[] itms)
{
return itms[Random.Next(0, itms.Length)];
return itms[Random.Next(0, (itms.Length-1 <= 0 )? 1 : itms.Length-1)];
}

public static IEnumerable<T> Repeatedly<T>(Func<T> f)
Expand Down

0 comments on commit 430cc42

Please sign in to comment.