diff options
author | Haru <haru@dotalux.com> | 2016-07-14 02:29:05 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-07-14 02:32:46 +0200 |
commit | a7c3d70ae42370b570bf25972089f2326ace6396 (patch) | |
tree | afdd60ab8a097d30071239a685ae148aed15b693 /src/map/atcommand.c | |
parent | 5d1a002d3b10e7e833790d85aad727a30fd5703c (diff) | |
download | hercules-a7c3d70ae42370b570bf25972089f2326ace6396.tar.gz hercules-a7c3d70ae42370b570bf25972089f2326ace6396.tar.bz2 hercules-a7c3d70ae42370b570bf25972089f2326ace6396.tar.xz hercules-a7c3d70ae42370b570bf25972089f2326ace6396.zip |
Changed pc->maxbaselv() and pc->maxjoblv() to return signed int and take const sd
Removes some FIXME (and continues a chain reaction)
Fixes some of the many -Wsign-compare warnings
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index eef67189a..18ea6cc01 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1364,12 +1364,12 @@ ACMD(baselevelup) } if (level > 0) { - if (sd->status.base_level >= pc->maxbaselv(sd)) { // check for max level by Valaris + if ((int)sd->status.base_level >= pc->maxbaselv(sd)) { // check for max level by Valaris // FIXME clif->message(fd, msg_fd(fd,47)); // Base level can't go any higher. return false; } // End Addition - if ((unsigned int)level > pc->maxbaselv(sd) || (unsigned int)level > pc->maxbaselv(sd) - sd->status.base_level) // fix positive overflow - level = pc->maxbaselv(sd) - sd->status.base_level; + if (level > pc->maxbaselv(sd) || level > pc->maxbaselv(sd) - (int)sd->status.base_level) // fix positive overflow // FIXME + level = pc->maxbaselv(sd) - (int)sd->status.base_level; // FIXME for (i = 0; i < level; i++) status_point += pc->gets_status_point(sd->status.base_level + i); @@ -1422,11 +1422,11 @@ ACMD(joblevelup) return false; } if (level > 0) { - if (sd->status.job_level >= pc->maxjoblv(sd)) { + if ((int)sd->status.job_level >= pc->maxjoblv(sd)) { // FIXME clif->message(fd, msg_fd(fd,23)); // Job level can't go any higher. return false; } - if ((unsigned int)level > pc->maxjoblv(sd) || (unsigned int)level > pc->maxjoblv(sd) - sd->status.job_level) // fix positive overflow + if (level > pc->maxjoblv(sd) || level > pc->maxjoblv(sd) - (int)sd->status.job_level) // fix positive overflow // FIXME level = pc->maxjoblv(sd) - sd->status.job_level; sd->status.job_level += (unsigned int)level; sd->status.skill_point += level; |