summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 15:04:11 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 15:04:11 +0000
commit78748079288acbd6e5fc7513baa70cf5b0a9a330 (patch)
treed2aada8ab9d3f91fbfd8f4453b527d5a1f1c13d9 /src/map/atcommand.c
parent802127420bf94a1f88696eb74feaf8917fa350cf (diff)
downloadhercules-78748079288acbd6e5fc7513baa70cf5b0a9a330.tar.gz
hercules-78748079288acbd6e5fc7513baa70cf5b0a9a330.tar.bz2
hercules-78748079288acbd6e5fc7513baa70cf5b0a9a330.tar.xz
hercules-78748079288acbd6e5fc7513baa70cf5b0a9a330.zip
- NPC_POWERUP now gives +40% atk per level.
- Water elementals can be frozen again. - Fixed the sc_def equation in status_change_start - Fixed an extra semi-colon that broke win32 compiles. - Some rewriting of bounds checks in @baselvup, @joblvup and the # equivalents to prevent signed/unsigned comparisons. - Now slaves give exp/loot (exception: player slaves still stick to the old rules) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5267 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 31bf7b3ce..99c13339d 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2680,7 +2680,7 @@ int atcommand_baselevelup(
clif_displaymessage(fd, msg_table[47]); /* Base level can't go any higher. */
return -1;
} /* End Addition */
- if (level > pc_maxbaselv(sd) || level > (pc_maxbaselv(sd) - (int)sd->status.base_level)) // fix positiv overflow
+ if (level > pc_maxbaselv(sd) || level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow
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;
@@ -2697,10 +2697,11 @@ int atcommand_baselevelup(
clif_displaymessage(fd, msg_table[158]); /* Base level can't go any lower. */
return -1;
}
- if (level < -(int)pc_maxbaselv(sd) || level < (1 - (int)sd->status.base_level)) /* fix negativ overflow */
- level = 1 - sd->status.base_level;
+ level*=-1;
+ if (level >= sd->status.base_level)
+ level = sd->status.base_level-1;
if (sd->status.status_point > 0) {
- for (i = 0; i > level; i--)
+ for (i = 0; i > -level; i--)
sd->status.status_point -= (sd->status.base_level + i + 14) / 5;
if (sd->status.status_point < 0)
sd->status.status_point = 0;
@@ -2739,7 +2740,7 @@ int atcommand_joblevelup(
clif_displaymessage(fd, msg_table[23]); // Job level can't go any higher.
return -1;
}
- if (level > pc_maxjoblv(sd) || level > (pc_maxjoblv(sd) - (int)sd->status.job_level)) // fix positiv overflow
+ if (level > pc_maxjoblv(sd) || level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow
level = pc_maxjoblv(sd) - sd->status.job_level;
sd->status.job_level += level;
clif_updatestatus(sd, SP_JOBLEVEL);
@@ -2754,13 +2755,14 @@ int atcommand_joblevelup(
clif_displaymessage(fd, msg_table[159]); // Job level can't go any lower.
return -1;
}
- if (level < -(int)pc_maxjoblv(sd) || level < (1 - (int)sd->status.job_level)) // fix negativ overflow
- level = 1 - sd->status.job_level;
- sd->status.job_level += level;
+ level *=-1;
+ if (level >= sd->status.job_level) // fix negativ overflow
+ level = sd->status.job_level-1;
+ sd->status.job_level -= level;
clif_updatestatus(sd, SP_JOBLEVEL);
clif_updatestatus(sd, SP_NEXTJOBEXP);
if (sd->status.skill_point > 0) {
- sd->status.skill_point += level;
+ sd->status.skill_point -= level;
if (sd->status.skill_point < 0)
sd->status.skill_point = 0;
clif_updatestatus(sd, SP_SKILLPOINT);