mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Limited entity spawning to 10
This commit is contained in:
parent
ff114a83b5
commit
767ced8fe7
@ -335,9 +335,10 @@ fn handle_spawn(server: &mut Server, entity: EcsEntity, args: String, action: &C
|
|||||||
(Some(opt_align), Some(id), opt_amount) => {
|
(Some(opt_align), Some(id), opt_amount) => {
|
||||||
if let Some(agent) = alignment_to_agent(&opt_align, entity) {
|
if let Some(agent) = alignment_to_agent(&opt_align, entity) {
|
||||||
let amount = opt_amount
|
let amount = opt_amount
|
||||||
.map_or(Some(1), |a| a.parse().ok())
|
.and_then(|a| a.parse().ok())
|
||||||
.and_then(|a| if a > 0 { Some(a) } else { None })
|
.filter(|x| *x > 0)
|
||||||
.unwrap();
|
.unwrap_or(1)
|
||||||
|
.min(10);
|
||||||
|
|
||||||
match server.state.read_component_cloned::<comp::Pos>(entity) {
|
match server.state.read_component_cloned::<comp::Pos>(entity) {
|
||||||
Some(pos) => {
|
Some(pos) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user