summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-13 07:33:18 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-13 07:33:18 +0000
commit7f7dc5fa3a49017cdb1c77f199d0967ba9c97958 (patch)
tree30fd062d1ebc978846f6a83e1a2e352220176fcd /src/map/atcommand.c
parent050c5b9ee1280c7023a06a0f366e323f4e56282a (diff)
downloadhercules-7f7dc5fa3a49017cdb1c77f199d0967ba9c97958.tar.gz
hercules-7f7dc5fa3a49017cdb1c77f199d0967ba9c97958.tar.bz2
hercules-7f7dc5fa3a49017cdb1c77f199d0967ba9c97958.tar.xz
hercules-7f7dc5fa3a49017cdb1c77f199d0967ba9c97958.zip
Prevented @stpoint and @skpoint from causing overflows.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14428 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 9fe589e73..44c44ff23 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2857,7 +2857,7 @@ int atcommand_statuspoint(const int fd, struct map_session_data* sd, const char*
if (point < 0 && sd->status.status_point < -point)
new_status_point = 0;
else
- new_status_point = sd->status.status_point + point;
+ new_status_point = cap_value(sd->status.status_point + point, 0, INT_MAX);
if (new_status_point != (int)sd->status.status_point) {
sd->status.status_point = new_status_point;
@@ -2890,7 +2890,7 @@ int atcommand_skillpoint(const int fd, struct map_session_data* sd, const char*
if (point < 0 && sd->status.skill_point < -point)
new_skill_point = 0;
else
- new_skill_point = sd->status.skill_point + point;
+ new_skill_point = cap_value(sd->status.skill_point + point, 0, INT_MAX);
if (new_skill_point != (int)sd->status.skill_point) {
sd->status.skill_point = new_skill_point;