New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow *input script command to support negative input #2375
Conversation
for avoid exploits, probably need check limit inside clif_parse_NpcAmountInput |
598d901
to
04e8afd
Compare
yeah, no idea who so clever wants to avoid it in the source code |
@MishimaHaruna from what i see it can be unsafe as is. because it allow negative value stored in npc variable and after other code will use it as it |
But as far as I'm aware it's already possible to store negative values in NPC variables (through direct assignment), am I missing anything? The default setting that this PR uses, provides the same behavior as before, in scripts that used to rely on |
For now |
better not allow unsafe values at first place and not check it every time before it can be used |
Oh I see, this is a good point. Let's move this to the next release then. |
I'm sorry, I'm too dump to understand your point |
it short into sd need add also variables |
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
04e8afd
to
797464b
Compare
you mean like this ? Hercules/doc/script_commands.txt Lines 1677 to 1683 in a3a1e36
in fact, I always do checks like this in my npc script |
variables optional only for scripts, inside buildin you always have limits from parameters or some default one. default i think 0 to INT_MAX |
I'm kinda give up, you can take over the 0 to INT_MAX has been double check by |
Pull Request Prelude
Issues addressed
input -100, always gets 0
Changes Proposed
blame clif.c, now allow negative input
Affected Branches
Known Issues and TODO List
rathena also allow it, why hercules don't ?