From 6e6a7fd110ceb66f2254d8b99062676327ee64f0 Mon Sep 17 00:00:00 2001 From: hemagx Date: Mon, 21 Dec 2015 00:10:51 +0200 Subject: 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 --- src/map/npc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/map/npc.c') 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 -- cgit v1.2.3-60-g2f50