summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAnnieRuru <jeankofannie2@gmail.com>2019-04-11 00:50:28 +0800
committerAnnieRuru <jeankofannie2@gmail.com>2019-04-11 00:50:28 +0800
commit797464b89910c4a04d0381a831001f4a7591ad28 (patch)
tree4cc92f83692637566d3b8bbb84204a1dcf033c9b /src/map/clif.c
parent55567b93ee5b287c632ff18327df6408f0cf4692 (diff)
downloadhercules-797464b89910c4a04d0381a831001f4a7591ad28.tar.gz
hercules-797464b89910c4a04d0381a831001f4a7591ad28.tar.bz2
hercules-797464b89910c4a04d0381a831001f4a7591ad28.tar.xz
hercules-797464b89910c4a04d0381a831001f4a7591ad28.zip
Add 3 pc variables just for the input limit ...
sd->npc_amount_min and sd->npc_amount_max to limit input range and sd->npc_input_capped_range because the documentation ask for it
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index cd3131181..037e168d0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -12587,10 +12587,19 @@ static void clif_parse_NpcAmountInput(int fd, struct map_session_data *sd)
int npcid = RFIFOL(fd,2);
int amount = RFIFOL(fd,6);
- if (amount >= 0)
+ if (amount < sd->npc_amount_min) {
+ sd->npc_amount = sd->npc_amount_min;
+ sd->npc_input_capped_range = -1;
+ }
+ else if (amount > sd->npc_amount_max) {
+ sd->npc_amount = sd->npc_amount_max;
+ sd->npc_input_capped_range = 1;
+ }
+ else {
sd->npc_amount = amount;
- else
- sd->npc_amount = 0;
+ sd->npc_input_capped_range = 0;
+ }
+
npc->scriptcont(sd, npcid, false);
}