summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-17 18:03:41 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-17 18:03:41 +0000
commit5bfda2252623ad1b118dea23101ed72c1e77b780 (patch)
tree178c1e75e1fbc72c147983ccae3229204ec4f276 /src
parent7b337e44d79cc427a0568d488de7831567409e50 (diff)
downloadhercules-5bfda2252623ad1b118dea23101ed72c1e77b780.tar.gz
hercules-5bfda2252623ad1b118dea23101ed72c1e77b780.tar.bz2
hercules-5bfda2252623ad1b118dea23101ed72c1e77b780.tar.xz
hercules-5bfda2252623ad1b118dea23101ed72c1e77b780.zip
Fixed bug with official npc idle timer thing, bugreport:5343
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15598 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/npc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 9a0eaa71f..12fce2ab4 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -214,9 +214,10 @@ struct npc_data* npc_name2id(const char* name)
**/
int npc_rr_secure_timeout_timer(int tid, unsigned int tick, int id, intptr_t data) {
struct map_session_data* sd = NULL;
- if( (sd = map_id2sd(id)) == NULL || !sd->npc_id )
+ if( (sd = map_id2sd(id)) == NULL || !sd->npc_id ) {
+ if( sd ) sd->npc_idle_timer = INVALID_TIMER;
return 0;//Not logged in anymore OR no longer attached to a npc
-
+ }
if( DIFF_TICK(tick,sd->npc_idle_tick) > (SECURE_NPCTIMEOUT*1000) ) {
/**
* If we still have the NPC script attached, tell it to stop.
@@ -227,6 +228,7 @@ int npc_rr_secure_timeout_timer(int tid, unsigned int tick, int id, intptr_t dat
* This guy's been idle for longer than allowed, close him.
**/
clif_scriptclose(sd,sd->npc_id);
+ sd->npc_idle_timer = INVALID_TIMER;
} else //Create a new instance of ourselves to continue
sd->npc_idle_timer = add_timer(gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc_rr_secure_timeout_timer,sd->bl.id,0);
return 0;