From 5bb9e91e22a1b188210146579b441c9cbdd9880b Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 2 Feb 2015 15:02:55 +0100 Subject: Fixed state tracking of dialog windows when the script is suspended and resumed - If a script was suspended, and then resumed (`sleep2`, but also `getexp`), state tracking of dialog windows would get reset, and a `close` or `close2` would trigger a warning even if a message box was present. - Special thanks to Dastgir. Signed-off-by: Haru --- src/map/clif.c | 1 + src/map/script.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/clif.c b/src/map/clif.c index be56f06cd..1d5bf8e31 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11268,6 +11268,7 @@ void clif_parse_NpcCloseClicked(int fd,struct map_session_data *sd) { if (!sd->npc_id) //Avoid parsing anything when the script was done with. [Skotlex] return; + sd->state.dialog = 0; npc->scriptcont(sd, RFIFOL(fd,2), true); } diff --git a/src/map/script.c b/src/map/script.c index f50e56d2d..a0b9f80cc 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3904,7 +3904,6 @@ void script_detach_state(struct script_state* st, bool dequeue_event) { if(st->rid && (sd = map->id2sd(st->rid))!=NULL) { sd->st = st->bk_st; sd->npc_id = st->bk_npcid; - sd->state.dialog = 0; if(st->bk_st) { //Remove tag for removal. st->bk_st = NULL; -- cgit v1.2.3-60-g2f50