diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-05-15 11:51:09 -0400 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-05-28 11:51:31 -0400 |
commit | 9ef0c24ba9c2cff4ae6fcf5884a14aa8111faf27 (patch) | |
tree | d76f245d9fb6ee97a70857c86b62e524a972f2f0 /src/map/atcommand.c | |
parent | cb3e2f5f3b91d0a1f7711eff9c10ae9a655a74f2 (diff) | |
download | hercules-9ef0c24ba9c2cff4ae6fcf5884a14aa8111faf27.tar.gz hercules-9ef0c24ba9c2cff4ae6fcf5884a14aa8111faf27.tar.bz2 hercules-9ef0c24ba9c2cff4ae6fcf5884a14aa8111faf27.tar.xz hercules-9ef0c24ba9c2cff4ae6fcf5884a14aa8111faf27.zip |
allow custom atcommands to have different permissions for each group
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 4d3a82ee2..221e9a311 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1408,7 +1408,7 @@ ACMD(baselevelup) pc->baselevelchanged(sd); if(sd->status.party_id) party->send_levelup(sd); - + if (level > 0 && battle_config.atcommand_levelup_events) npc->script_event(sd, NPCE_BASELVUP); // Trigger OnPCBaseLvUpEvent @@ -8398,7 +8398,9 @@ void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommand int gm_lvl = pc_get_group_level(sd); for (i = 0; i < atcommand->binding_count; i++) { - if (gm_lvl >= ((type == COMMAND_ATCOMMAND) ? atcommand->binding[i]->group_lv : atcommand->binding[i]->group_lv_char)) { + if (gm_lvl >= ((type == COMMAND_ATCOMMAND) ? atcommand->binding[i]->group_lv : atcommand->binding[i]->group_lv_char) + || (type == COMMAND_ATCOMMAND && atcommand->binding[i]->at_groups[pcg->get_idx(sd->group)] > 0) + || (type == COMMAND_CHARCOMMAND && atcommand->binding[i]->char_groups[pcg->get_idx(sd->group)] > 0)) { size_t slen = strlen(atcommand->binding[i]->command); if (count_bind == 0) { cur = line_buff; @@ -9961,6 +9963,8 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa && ( (is_atcommand && pc_get_group_level(sd) >= binding->group_lv) || (!is_atcommand && pc_get_group_level(sd) >= binding->group_lv_char) + || (is_atcommand && binding->at_groups[pcg->get_idx(sd->group)] > 0) + || (!is_atcommand && binding->char_groups[pcg->get_idx(sd->group)] > 0) ) ) { if (binding->log) /* log only if this command should be logged [Ind/Hercules] */ |