From cd14fbcc304f14f3a49375e03e52b6cb3ee59fe8 Mon Sep 17 00:00:00 2001 From: Beck Date: Tue, 9 Jun 2026 00:47:52 -0700 Subject: [PATCH 1/2] update ::item to actually default to one amount --- .../src/main/core/game/system/command/sets/SpawnCommandSet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt b/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt index 468bdaf96..f4622e20b 100644 --- a/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt +++ b/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt @@ -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() ?: 1 if (id > Cache.getItemDefinitionsSize()) { reject(player,"Item ID '$id' out of range.") return@define From d708b065fc2963bd3adf6386522169d532554e37 Mon Sep 17 00:00:00 2001 From: Beck Date: Tue, 9 Jun 2026 01:48:12 -0700 Subject: [PATCH 2/2] rewrite negative integer amounts to 1 --- .../src/main/core/game/system/command/sets/SpawnCommandSet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt b/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt index f4622e20b..bfa27e642 100644 --- a/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt +++ b/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt @@ -67,7 +67,7 @@ class SpawnCommandSet : CommandSet(Privilege.ADMIN){ return@define } val id = args[1].toIntOrNull() ?: return@define - var amount = args.getOrNull(2)?.toIntOrNull() ?: 1 + var amount = args.getOrNull(2)?.toIntOrNull()?.takeIf { it > 0 } ?: 1 if (id > Cache.getItemDefinitionsSize()) { reject(player,"Item ID '$id' out of range.") return@define