mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
chat warning for unknown objects
This commit is contained in:
parent
85281e7e54
commit
9fd2849c6c
@ -27,7 +27,7 @@ pub enum Body {
|
||||
PotionGreen,
|
||||
PotionRed,
|
||||
Crate,
|
||||
Tent,
|
||||
Tent,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
@ -63,5 +63,5 @@ const ALL_OBJECTS: [Body; 26] = [
|
||||
Body::PotionBlue,
|
||||
Body::PotionGreen,
|
||||
Body::Crate,
|
||||
Body::Tent,
|
||||
Body::Tent,
|
||||
];
|
||||
|
@ -313,7 +313,7 @@ fn handle_spawn(server: &mut Server, entity: EcsEntity, args: String, action: &C
|
||||
let (opt_align, opt_id, opt_amount) = scan_fmt!(&args, action.arg_fmt, String, NpcKind, String);
|
||||
// This should be just an enum handled with scan_fmt!
|
||||
let opt_agent = alignment_to_agent(&opt_align.unwrap_or(String::new()), entity);
|
||||
let objtype = scan_fmt!(&args, action.arg_fmt, String);
|
||||
let _objtype = scan_fmt!(&args, action.arg_fmt, String);
|
||||
// Make sure the amount is either not provided or a valid value
|
||||
let opt_amount = opt_amount
|
||||
.map_or(Some(1), |a| a.parse().ok())
|
||||
@ -487,8 +487,11 @@ fn handle_object(server: &mut Server, entity: EcsEntity, args: String, _action:
|
||||
Some("Crate") => comp::object::Body::Crate,
|
||||
Some("Tent") => comp::object::Body::Tent,
|
||||
Some("Bomb") => comp::object::Body::Bomb,
|
||||
Some(&_) => (return),
|
||||
None => (return),
|
||||
_ => {
|
||||
return server
|
||||
.clients
|
||||
.notify(entity, ServerMsg::Chat(String::from("Object not found!")));
|
||||
}
|
||||
};
|
||||
server.create_object(pos, obj_type).build();
|
||||
server
|
||||
|
@ -547,7 +547,7 @@ impl FigureModelCache {
|
||||
object::Body::PotionBlue => ("object/potion_blue.vox", Vec3::new(-2.0, -2.0, 0.0)),
|
||||
object::Body::PotionGreen => ("object/potion_green.vox", Vec3::new(-2.0, -2.0, 0.0)),
|
||||
object::Body::Crate => ("object/crate.vox", Vec3::new(-7.0, -7.0, 0.0)),
|
||||
object::Body::Tent => ("object/tent.vox", Vec3::new(-18.5, -19.5, 0.0)),
|
||||
object::Body::Tent => ("object/tent.vox", Vec3::new(-18.5, -19.5, 0.0)),
|
||||
};
|
||||
Self::load_mesh(name, offset)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user