Skip to content

Commit 430cc42

Browse files
index out of bounds fix
1 parent 89b078c commit 430cc42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

HalgarisRPGLoot/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class Extensions
1313

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

1919
public static IEnumerable<T> Repeatedly<T>(Func<T> f)

0 commit comments

Comments
 (0)