Add /kill command for easier testing

Former-commit-id: 9f27dcfd5c99327fdc6e30cac30afa5cc75cec95
This commit is contained in:
timokoesters 2019-05-19 23:54:09 +02:00
parent 69cd712ca9
commit 616b922e36

View File

@ -75,6 +75,12 @@ lazy_static! {
"/tp <alias> : Teleport to another player",
handle_tp
),
ChatCommand::new(
"kill",
"{}",
"/kill : Kill yourself",
handle_kill
),
ChatCommand::new(
"pet",
"{}",
@ -132,6 +138,12 @@ fn handle_goto(server: &mut Server, entity: EcsEntity, args: String, action: &Ch
}
}
fn handle_kill(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) {
server
.state
.write_component::<comp::Dying>(entity, comp::Dying)
}
fn handle_alias(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) {
let opt_alias = scan_fmt!(&args, action.arg_fmt, String);
match opt_alias {