summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorhemagx <hemagx2@gmail.com>2015-12-21 00:10:51 +0200
committerhemagx <hemagx2@gmail.com>2015-12-21 00:12:49 +0200
commit6e6a7fd110ceb66f2254d8b99062676327ee64f0 (patch)
tree674bfd509f4c51885964c4f6a00f22454a08dc71 /src/map/npc.c
parent6d9fad2647d8fcc4b8f141787c53bd9d77d9b133 (diff)
downloadhercules-6e6a7fd110ceb66f2254d8b99062676327ee64f0.tar.gz
hercules-6e6a7fd110ceb66f2254d8b99062676327ee64f0.tar.bz2
hercules-6e6a7fd110ceb66f2254d8b99062676327ee64f0.tar.xz
hercules-6e6a7fd110ceb66f2254d8b99062676327ee64f0.zip
Fix Client stuck if npc secure time reached and no actual dialog presented to client.
Fix dialog being cleared if npc secure time reached and dialog exist Fixes #916
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 82365efba..9af6de518 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -313,8 +313,13 @@ int npc_rr_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) {
* This guy's been idle for longer than allowed, close him.
**/
clif->scriptclose(sd,sd->npc_id);
- clif->scriptclear(sd,sd->npc_id);
sd->npc_idle_timer = INVALID_TIMER;
+ /**
+ * We will end the script ourselves, client will request to end it again if it have dialog,
+ * however it will be ignored, workaround for client stuck if NPC have no dialog. [hemagx]
+ **/
+ sd->state.dialog = 0;
+ npc->scriptcont(sd, sd->npc_id, true);
} else //Create a new instance of ourselves to continue
sd->npc_idle_timer = timer->add(timer->gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc->secure_timeout_timer,sd->bl.id,0);
#endif