diff options
author | Mysterious <mysteriousragnarok@hotmail.com> | 2013-02-03 17:59:43 -0800 |
---|---|---|
committer | Mysterious <mysteriousragnarok@hotmail.com> | 2013-02-03 17:59:43 -0800 |
commit | 9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9 (patch) | |
tree | a9b1a6855824986b8bfa47a98236d30a1f2e1d33 /src/map/script.c | |
parent | ac7c180e10c5c84eae1ef8769942853ac8abc6f9 (diff) | |
parent | fe8d3fc42729f2afc37426e26080b2d04f65d9f3 (diff) | |
download | hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.tar.gz hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.tar.bz2 hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.tar.xz hercules-9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9.zip |
Merge pull request #1 from HerculesWS/master
Merging
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/map/script.c b/src/map/script.c index 4099820f1..60a61654a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3590,30 +3590,26 @@ static void script_detach_state(struct script_state* st, bool dequeue_event) { struct map_session_data* sd; - if(st->rid && (sd = map_id2sd(st->rid))!=NULL) - { + if(st->rid && (sd = map_id2sd(st->rid))!=NULL) { sd->st = st->bk_st; sd->npc_id = st->bk_npcid; - /** - * For the Secure NPC Timeout option (check config/Secure.h) [RR] - **/ - #if SECURE_NPCTIMEOUT - /** - * We're done with this NPC session, so we cancel the timer (if existent) and move on - **/ - if( sd->npc_idle_timer != INVALID_TIMER ) { - delete_timer(sd->npc_idle_timer,npc_rr_secure_timeout_timer); - sd->npc_idle_timer = INVALID_TIMER; - } - #endif - if(st->bk_st) - { + if(st->bk_st) { //Remove tag for removal. st->bk_st = NULL; st->bk_npcid = 0; - } - else if(dequeue_event) - { + } else if(dequeue_event) { + /** + * For the Secure NPC Timeout option (check config/Secure.h) [RR] + **/ +#if SECURE_NPCTIMEOUT + /** + * We're done with this NPC session, so we cancel the timer (if existent) and move on + **/ + if( sd->npc_idle_timer != INVALID_TIMER ) { + delete_timer(sd->npc_idle_timer,npc_rr_secure_timeout_timer); + sd->npc_idle_timer = INVALID_TIMER; + } +#endif npc_event_dequeue(sd); } } |