summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-05-10 15:46:32 -0300
committerpanikon <panikon@zoho.com>2014-05-10 15:46:32 -0300
commitd689201d7b42d26948f5013b6985ec2c4e5beac3 (patch)
treec17580543d79c8eeeb036ef1e0ba447b287e0c2d /src
parent7fc4d0ce2bce6e896ad4aa5d16348f14e5039189 (diff)
downloadhercules-d689201d7b42d26948f5013b6985ec2c4e5beac3.tar.gz
hercules-d689201d7b42d26948f5013b6985ec2c4e5beac3.tar.bz2
hercules-d689201d7b42d26948f5013b6985ec2c4e5beac3.tar.xz
hercules-d689201d7b42d26948f5013b6985ec2c4e5beac3.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c6
1 files changed, 5 insertions, 1 deletions
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;
}