From 0bec4034abe023e3f3759506ac95237aa2d82512 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 31 Jul 2013 12:21:22 -0300 Subject: New 'close2' warning When attempting to use this command without a prior dialog window it now will throw a warning and skip halting the script. Special Thanks to j-tkay, Gepard. Signed-off-by: shennetsind --- src/map/script.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index 3033a281b..4385ef07d 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3942,7 +3942,13 @@ BUILDIN(close2) { if( sd == NULL ) return true; - st->state = STOP; + if( sd->state.dialog == 1 ) + st->state = STOP; + else { + ShowWarning("misuse of 'close2'! trying to use it without prior dialog! skipping...\n"); + script_reportsrc(st); + } + clif->scriptclose(sd, st->oid); return true; } -- cgit v1.2.3-70-g09d2