summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-15 13:19:16 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-15 13:19:16 +0000
commitaf3903eef455c03277036c972bc8c53e6ddacd28 (patch)
tree244d3dbbe28a1ec9f4842b68e4e216dd7d21b3f6
parent26d26735a1a8c73bd466cf1942f842a66eaabc62 (diff)
downloadhercules-af3903eef455c03277036c972bc8c53e6ddacd28.tar.gz
hercules-af3903eef455c03277036c972bc8c53e6ddacd28.tar.bz2
hercules-af3903eef455c03277036c972bc8c53e6ddacd28.tar.xz
hercules-af3903eef455c03277036c972bc8c53e6ddacd28.zip
- Fixed @lvup commmand raising levels when you specify a negative value.. again. Some more signedness checks.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5286 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/atcommand.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 122bfe077..f39c63dc3 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2684,7 +2684,7 @@ int atcommand_baselevelup(
level = pc_maxbaselv(sd) - sd->status.base_level;
for (i = 1; i <= level; i++)
sd->status.status_point += (sd->status.base_level + i + 14) / 5;
- sd->status.base_level += level;
+ sd->status.base_level += (unsigned int)level;
clif_updatestatus(sd, SP_BASELEVEL);
clif_updatestatus(sd, SP_NEXTBASEEXP);
clif_updatestatus(sd, SP_STATUSPOINT);
@@ -2707,7 +2707,7 @@ int atcommand_baselevelup(
sd->status.status_point = 0;
clif_updatestatus(sd, SP_STATUSPOINT);
} /* to add: remove status points from stats */
- sd->status.base_level -= level;
+ sd->status.base_level -= (unsigned int)level;
clif_updatestatus(sd, SP_BASELEVEL);
clif_updatestatus(sd, SP_NEXTBASEEXP);
status_calc_pc(sd, 0);
@@ -2741,7 +2741,7 @@ int atcommand_joblevelup(
}
if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow
level = pc_maxjoblv(sd) - sd->status.job_level;
- sd->status.job_level += level;
+ sd->status.job_level += (unsigned int)level;
clif_updatestatus(sd, SP_JOBLEVEL);
clif_updatestatus(sd, SP_NEXTJOBEXP);
sd->status.skill_point += level;
@@ -2757,7 +2757,7 @@ int atcommand_joblevelup(
level *=-1;
if ((unsigned int)level >= sd->status.job_level) // fix negativ overflow
level = sd->status.job_level-1;
- sd->status.job_level -= level;
+ sd->status.job_level -= (unsigned int)level;
clif_updatestatus(sd, SP_JOBLEVEL);
clif_updatestatus(sd, SP_NEXTJOBEXP);
if (sd->status.skill_point < level)