Merge branch 'tell_fix' into 'master'

Fix tell command, rename to /tell

See merge request veloren/veloren!343
This commit is contained in:
Joshua Barretto 2019-07-20 16:10:16 +00:00
commit 58a41d4bec

View File

@ -119,10 +119,10 @@ lazy_static! {
handle_build, handle_build,
), ),
ChatCommand::new( ChatCommand::new(
"msg", "tell",
"{}", "{}",
"/msg <alias> : Send a message to another player", "/tell <alias> <message>: Send a message to another player",
handle_msg, handle_tell,
), ),
ChatCommand::new( ChatCommand::new(
"killnpcs", "killnpcs",
@ -437,7 +437,7 @@ fn handle_killnpcs(server: &mut Server, entity: EcsEntity, _args: String, _actio
server.clients.notify(entity, ServerMsg::Chat(text)); server.clients.notify(entity, ServerMsg::Chat(text));
} }
fn handle_msg(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { fn handle_tell(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) {
let opt_alias = scan_fmt!(&args, action.arg_fmt, String); let opt_alias = scan_fmt!(&args, action.arg_fmt, String);
match opt_alias { match opt_alias {
Some(alias) => { Some(alias) => {
@ -462,8 +462,8 @@ fn handle_msg(server: &mut Server, entity: EcsEntity, args: String, action: &Cha
ServerMsg::Chat(format!("{} tells you:{}", name, msg)), ServerMsg::Chat(format!("{} tells you:{}", name, msg)),
); );
server.clients.notify( server.clients.notify(
player, entity,
ServerMsg::Chat(format!("You tell {} {}", alias, msg)), ServerMsg::Chat(format!("You tell {}:{}", alias, msg)),
); );
} }
None => { None => {