mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'which_object_spawned' into 'master'
Tells the user which object was spawned See merge request veloren/veloren!368
This commit is contained in:
commit
53c0992fd5
@ -555,7 +555,8 @@ fn handle_object(server: &mut Server, entity: EcsEntity, args: String, _action:
|
|||||||
.create_object(pos, ori, obj_type)
|
.create_object(pos, ori, obj_type)
|
||||||
.with(ori);*/
|
.with(ori);*/
|
||||||
if let (Some(pos), Some(ori)) = (pos, ori) {
|
if let (Some(pos), Some(ori)) = (pos, ori) {
|
||||||
let obj_type = match obj_type.as_ref().map(String::as_str) {
|
let obj_str_res = obj_type.as_ref().map(String::as_str);
|
||||||
|
let obj_type = match obj_str_res {
|
||||||
Ok("scarecrow") => comp::object::Body::Scarecrow,
|
Ok("scarecrow") => comp::object::Body::Scarecrow,
|
||||||
Ok("cauldron") => comp::object::Body::Cauldron,
|
Ok("cauldron") => comp::object::Body::Cauldron,
|
||||||
Ok("chest_vines") => comp::object::Body::ChestVines,
|
Ok("chest_vines") => comp::object::Body::ChestVines,
|
||||||
@ -624,9 +625,13 @@ fn handle_object(server: &mut Server, entity: EcsEntity, args: String, _action:
|
|||||||
.normalized(),
|
.normalized(),
|
||||||
))
|
))
|
||||||
.build();
|
.build();
|
||||||
server
|
server.clients.notify(
|
||||||
.clients
|
entity,
|
||||||
.notify(entity, ServerMsg::private(format!("Spawned object.")));
|
ServerMsg::private(format!(
|
||||||
|
"Spawned: {}",
|
||||||
|
obj_str_res.unwrap_or("<Unknown object>")
|
||||||
|
)),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
server
|
server
|
||||||
.clients
|
.clients
|
||||||
|
Loading…
Reference in New Issue
Block a user