summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-09 03:51:18 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-09 03:51:18 +0000
commit400200948796c1fcd529b79a1026be4064c37b67 (patch)
tree92a0ae7b09c8b5b96e8e5d11bb3a47d8dc32c6de /src/map
parent43b44e59a86da8c2bc9103bb28ccf1cd9a86b104 (diff)
downloadhercules-400200948796c1fcd529b79a1026be4064c37b67.tar.gz
hercules-400200948796c1fcd529b79a1026be4064c37b67.tar.bz2
hercules-400200948796c1fcd529b79a1026be4064c37b67.tar.xz
hercules-400200948796c1fcd529b79a1026be4064c37b67.zip
- Modified guild exp to be an unsigned int rather than a signed one.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7059 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/guild.c10
-rw-r--r--src/map/intif.c5
2 files changed, 10 insertions, 5 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 3d4aeb9f7..9fa9d16c6 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -367,8 +367,8 @@ int guild_payexp_timer_sub(DBKey dataid, void *data, va_list ap)
return 0;
}
- if ((unsigned int)g->member[i].exp > INT_MAX - c->exp)
- g->member[i].exp = INT_MAX;
+ if (g->member[i].exp > UINT_MAX - c->exp)
+ g->member[i].exp = UINT_MAX;
else
g->member[i].exp+= c->exp;
@@ -1139,6 +1139,8 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
nullpo_retr(0, sd);
+ if (!exp) return 0;
+
if (sd->status.guild_id == 0 ||
(g = guild_search(sd->status.guild_id)) == NULL ||
(per = g->position[guild_getposition(sd,g)].exp_mode) <= 0)
@@ -1149,7 +1151,9 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
else
if (per < 1) return 0;
- if ((tmp = exp * per / 100) <= 0)
+
+ tmp = exp * per / 100;
+ if (tmp <= 0)
return 0;
exp2 = (unsigned int)tmp;
diff --git a/src/map/intif.c b/src/map/intif.c
index fc7fd6c3d..4081997d6 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -1166,7 +1166,8 @@ int intif_parse_GuildBroken(int fd)
// ギルド基本情報変更通知
int intif_parse_GuildBasicInfoChanged(int fd)
{
- int type, guild_id, dd;
+ int type, guild_id;
+ unsigned int dd;
void *data;
struct guild *g;
short dw;
@@ -1176,7 +1177,7 @@ int intif_parse_GuildBasicInfoChanged(int fd)
data=RFIFOP(fd,10);
g=guild_search(guild_id);
dw=*((short *)data);
- dd=*((int *)data);
+ dd=*((unsigned int *)data);
if( g==NULL )
return 0;
switch(type){