mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'soruh/veloren-help-only-show-allowed-main-repo' into 'master'
Don't display commands that the player cannot use. Closes #351 See merge request veloren/veloren!612
This commit is contained in:
commit
d35ca01b1e
@ -516,14 +516,15 @@ fn handle_build(server: &mut Server, entity: EcsEntity, _args: String, _action:
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Don't display commands that the player cannot use.
|
||||
fn handle_help(server: &mut Server, entity: EcsEntity, _args: String, _action: &ChatCommand) {
|
||||
for cmd in CHAT_COMMANDS.iter() {
|
||||
if !cmd.needs_admin || server.entity_is_admin(entity) {
|
||||
server
|
||||
.clients
|
||||
.notify(entity, ServerMsg::private(String::from(cmd.help_string)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn alignment_to_agent(alignment: &str, target: EcsEntity) -> Option<comp::Agent> {
|
||||
match alignment {
|
||||
|
Loading…
Reference in New Issue
Block a user