- Fixed 'atcommand' script failure for group with 'command_enable: false' (bugreport:9050)

- Replaced 'atcommand_max_stat_bypass' config (conf/gm.conf) to group permission 'bypass_max_stat'

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
This commit is contained in:
Cydh Ramdh
2014-07-07 12:26:07 +07:00
parent fcd79d63aa
commit be9ffaf7e6
9 changed files with 19 additions and 11 deletions

View File

@@ -3769,6 +3769,7 @@ static void script_detach_state(struct script_state* st, bool dequeue_event)
if(st->rid && (sd = map_id2sd(st->rid))!=NULL) {
sd->st = st->bk_st;
sd->npc_id = st->bk_npcid;
sd->state.disable_atcommand_on_npc = 0;
if(st->bk_st) {
//Remove tag for removal.
st->bk_st = NULL;
@@ -3818,7 +3819,7 @@ static void script_attach_state(struct script_state* st)
sd->st = st;
sd->npc_id = st->oid;
sd->npc_item_flag = st->npc_item_flag; // load default.
sd->state.disable_atcommand_on_npc = !pc_has_permission(sd, PC_PERM_ENABLE_COMMAND);
sd->state.disable_atcommand_on_npc = (!pc_has_permission(sd, PC_PERM_ENABLE_COMMAND));
#ifdef SECURE_NPCTIMEOUT
if( sd->npc_idle_timer == INVALID_TIMER )
sd->npc_idle_timer = add_timer(gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc_rr_secure_timeout_timer,sd->bl.id,0);