diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-08-28 16:13:33 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-08-28 16:16:03 -0700 |
commit | 1aa55242d929fd85ceaa462348e3ecb2636487bc (patch) | |
tree | 57b2a2f9c6e16aa7fd8fa3d9793267b06aea3e0d /src/map/script.cpp | |
parent | 7245589dcbc08c377f783a637deeaa09604c6213 (diff) | |
download | tmwa-1aa55242d929fd85ceaa462348e3ecb2636487bc.tar.gz tmwa-1aa55242d929fd85ceaa462348e3ecb2636487bc.tar.bz2 tmwa-1aa55242d929fd85ceaa462348e3ecb2636487bc.tar.xz tmwa-1aa55242d929fd85ceaa462348e3ecb2636487bc.zip |
Prevent skills from being set out of bounds by privileged users
Diffstat (limited to 'src/map/script.cpp')
-rw-r--r-- | src/map/script.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp index 4aeb7d9..40dfc0e 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -2414,6 +2414,8 @@ void builtin_setskill(ScriptState *st) level = conv_num(st, &AARGO2(3)); sd = script_rid2sd(st); + level = std::min(level, MAX_SKILL_LEVEL); + level = std::max(level, 0); sd->status.skill[id].lv = level; clif_skillinfoblock(sd); } |