From d689201d7b42d26948f5013b6985ec2c4e5beac3 Mon Sep 17 00:00:00 2001 From: panikon Date: Sat, 10 May 2014 15:46:32 -0300 Subject: Changed set_reg behavior on pc_setparam failure, now it won't simply END the script, if a dialog window is open it'll also CLOSE it. Corrected Zeny formula in THQS --- src/map/script.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/map') diff --git a/src/map/script.c b/src/map/script.c index 4195e40fc..b432e6720 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2924,7 +2924,11 @@ int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, co if( st != NULL ) { ShowError("script:set_reg: failed to set param '%s' to %d.\n", name, val); script->reportsrc(st); - st->state = END; + // Instead of just stop the script execution we let the character close + // the window if it was open. + st->state = (sd->state.dialog) ? CLOSE : END; + if( st->state == CLOSE ) + clif->scriptclose(sd, st->oid); } return 0; } -- cgit v1.2.3-70-g09d2