Fix spawning few entities at once

This commit is contained in:
Piotr Korgól 2019-06-28 18:58:47 +02:00
parent 89fbc86eb5
commit 44862d0acc

View File

@ -262,8 +262,8 @@ fn handle_spawn(server: &mut Server, entity: EcsEntity, args: String, action: &C
match server.state.read_component_cloned::<comp::Pos>(entity) {
Some(mut pos) => {
pos.0.x += 1.0; // Temp fix TODO: Solve NaN issue with positions of pets
let body = kind_to_body(id);
for _ in 0..amount {
let body = kind_to_body(id);
server
.create_npc(pos, get_npc_name(id), body)
.with(agent)