Comand for specific model spawning part I

This commit is contained in:
Pfauenauge90 2019-07-23 19:20:29 +02:00
parent f3c5ece983
commit f6e24d8161

View File

@ -458,9 +458,12 @@ fn handle_object(server: &mut Server, entity: EcsEntity, _args: String, _action:
.get(entity) .get(entity)
.copied(); .copied();
if let Some(pos) = pos { if let Some(pos) = pos {
server let object_type = match objtype {
.create_object(pos, comp::object::Body::random()) "Tent" => comp::object::Body::Tent,
.build(); "Bomb" => comp::object::Body::Bomb,
"_" => None
};
server.create_object(pos, object_type).build()
server server
.clients .clients
.notify(entity, ServerMsg::Chat(format!("Spawned object."))); .notify(entity, ServerMsg::Chat(format!("Spawned object.")));