summaryrefslogtreecommitdiff
path: root/src/map/script.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-08-28 16:13:33 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-08-28 16:16:03 -0700
commit1aa55242d929fd85ceaa462348e3ecb2636487bc (patch)
tree57b2a2f9c6e16aa7fd8fa3d9793267b06aea3e0d /src/map/script.cpp
parent7245589dcbc08c377f783a637deeaa09604c6213 (diff)
downloadtmwa-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.cpp2
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);
}