Merge branch 'item_cmd_default_amt' into 'master'

Update ::item to default to one amount when no 2nd argument given

See merge request 2009scape/2009scape!2404
This commit is contained in:
Beck 2026-08-01 05:06:39 +00:00
commit b57500ca48

View file

@ -67,7 +67,7 @@ class SpawnCommandSet : CommandSet(Privilege.ADMIN){
return@define
}
val id = args[1].toIntOrNull() ?: return@define
var amount = (args.getOrNull(2) ?: "1").toInt()
var amount = args.getOrNull(2)?.toIntOrNull()?.takeIf { it > 0 } ?: 1
if (id > Cache.getItemDefinitionsSize()) {
reject(player,"Item ID '$id' out of range.")
return@define