summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-01 12:08:02 -0200
committershennetsind <ind@henn.et>2013-02-01 12:08:02 -0200
commit7192b105201499e30a50c061e7ab2005c97d3714 (patch)
treed5e482a4c36b9a9ba77f9ffeba038b235a9f19d0 /src/map/script.c
parent74ed3ed32f33ad4df945718389d7d74ab0a53794 (diff)
downloadhercules-7192b105201499e30a50c061e7ab2005c97d3714.tar.gz
hercules-7192b105201499e30a50c061e7ab2005c97d3714.tar.bz2
hercules-7192b105201499e30a50c061e7ab2005c97d3714.tar.xz
hercules-7192b105201499e30a50c061e7ab2005c97d3714.zip
Fixed Bug #5343
SECURE_NPCTIMEOUT should be fully functional now, fixed remaining known issues. http://hercules.ws/board/tracker/issue-5343-delete-timer-error/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c34
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);
}
}