Skip to content

Commit

Permalink
ok it doesnt crash above max
Browse files Browse the repository at this point in the history
  • Loading branch information
hellidox committed Aug 23, 2024
1 parent 067c56d commit 97e6760
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private static Value getItem(Starscript ss, int argCount) {
if (argCount != 1) ss.error("player.get_item() requires 1 argument, got %d.", argCount);

int i = (int) ss.popNumber("First argument to player.get_item() needs to be a number.");
if (i < 0 || i > 35) ss.error("First argument to player.get_item() needs to be between 0 and 35 (inclusive).", i);
if (i < 0) ss.error("First argument to player.get_item() needs to be a non-negative integer.", i);
return mc.player != null ? wrap(mc.player.getInventory().getStack(i)) : Value.null_();
}

Expand Down

0 comments on commit 97e6760

Please sign in to comment.