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,12 +516,13 @@ 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() {
|
||||
server
|
||||
.clients
|
||||
.notify(entity, ServerMsg::private(String::from(cmd.help_string)));
|
||||
if !cmd.needs_admin || server.entity_is_admin(entity) {
|
||||
server
|
||||
.clients
|
||||
.notify(entity, ServerMsg::private(String::from(cmd.help_string)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user