mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add /kill command for easier testing
Former-commit-id: 9f27dcfd5c99327fdc6e30cac30afa5cc75cec95
This commit is contained in:
parent
69cd712ca9
commit
616b922e36
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user