make minimum spawn amount higher than 0

This commit is contained in:
liids 2019-06-15 14:30:05 +02:00
parent f726d755b7
commit 8b2b931c17

View File

@ -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<u32> = if let Some(amount) = opt_amount {
amount.parse().ok()
match amount.parse().ok() {
Some(x) if x == 0 => None,
x => x
}
} else {
Some(1)
};