summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-02-20 19:47:17 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-02-20 19:47:17 +0000
commit72c7b505f1aee0d307f0dfc985d53c66e29fdf56 (patch)
tree80704d27eb459db5a96014cb86ec96f099be42d6 /src/map/atcommand.c
parent6765daf13f27924282acbeed84f4481c04338596 (diff)
downloadhercules-72c7b505f1aee0d307f0dfc985d53c66e29fdf56.tar.gz
hercules-72c7b505f1aee0d307f0dfc985d53c66e29fdf56.tar.bz2
hercules-72c7b505f1aee0d307f0dfc985d53c66e29fdf56.tar.xz
hercules-72c7b505f1aee0d307f0dfc985d53c66e29fdf56.zip
Increased variable size for status/skill points to remove the 65k cap (bugreport:1579).
Added sql upgrade script to adjust the appropriate char table columns. This is an enhancement to r5762. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13541 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 7139c6935..4c8766a4c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1739,10 +1739,7 @@ int atcommand_baselevelup(const int fd, struct map_session_data* sd, const char*
for (i = 1; i <= level; i++)
status_point += (sd->status.base_level + i + 14) / 5;
- if (sd->status.status_point > USHRT_MAX - status_point)
- sd->status.status_point = USHRT_MAX;
- else
- sd->status.status_point += status_point;
+ sd->status.status_point += status_point;
sd->status.base_level += (unsigned int)level;
status_percent_heal(&sd->bl, 100, 100);
clif_misceffect(&sd->bl, 0);
@@ -1799,10 +1796,7 @@ int atcommand_joblevelup(const int fd, struct map_session_data* sd, const char*
sd->status.job_level += (unsigned int)level;
clif_updatestatus(sd, SP_JOBLEVEL);
clif_updatestatus(sd, SP_NEXTJOBEXP);
- if (sd->status.skill_point > USHRT_MAX - level)
- sd->status.skill_point = USHRT_MAX;
- else
- sd->status.skill_point += level;
+ sd->status.skill_point += level;
clif_updatestatus(sd, SP_SKILLPOINT);
status_calc_pc(sd, 0);
clif_misceffect(&sd->bl, 1);
@@ -2848,15 +2842,13 @@ int atcommand_statuspoint(const int fd, struct map_session_data* sd, const char*
return -1;
}
- if (point > 0 && sd->status.status_point > USHRT_MAX - point)
- new_status_point = USHRT_MAX;
- else
if (point < 0 && sd->status.status_point < -point)
new_status_point = 0;
else
new_status_point = sd->status.status_point + point;
+
if (new_status_point != (int)sd->status.status_point) {
- sd->status.status_point = (unsigned short)new_status_point;
+ sd->status.status_point = new_status_point;
clif_updatestatus(sd, SP_STATUSPOINT);
clif_displaymessage(fd, msg_txt(174)); // Number of status points changed.
} else {
@@ -2883,15 +2875,13 @@ int atcommand_skillpoint(const int fd, struct map_session_data* sd, const char*
return -1;
}
- if (point > 0 && sd->status.skill_point > USHRT_MAX - point)
- new_skill_point = USHRT_MAX;
- else if (point < 0 && sd->status.skill_point < -point)
+ if (point < 0 && sd->status.skill_point < -point)
new_skill_point = 0;
else
new_skill_point = sd->status.skill_point + point;
if (new_skill_point != (int)sd->status.skill_point) {
- sd->status.skill_point = (unsigned short)new_skill_point;
+ sd->status.skill_point = new_skill_point;
clif_updatestatus(sd, SP_SKILLPOINT);
clif_displaymessage(fd, msg_txt(175)); // Number of skill points changed.
} else {