From 8b2b931c170d0113c0f0d94439d83cb987c70e19 Mon Sep 17 00:00:00 2001 From: liids Date: Sat, 15 Jun 2019 14:30:05 +0200 Subject: [PATCH] make minimum spawn amount higher than 0 --- server/src/cmd.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/cmd.rs b/server/src/cmd.rs index ed6c67b9b5..51767a6a8a 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -217,7 +217,10 @@ fn handle_spawn(server: &mut Server, entity: EcsEntity, args: String, action: &C // Make sure the amount is either not provided or a valid value let opt_amount: Option = if let Some(amount) = opt_amount { - amount.parse().ok() + match amount.parse().ok() { + Some(x) if x == 0 => None, + x => x + } } else { Some(1) };