diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 03:51:18 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 03:51:18 +0000 |
commit | 400200948796c1fcd529b79a1026be4064c37b67 (patch) | |
tree | 92a0ae7b09c8b5b96e8e5d11bb3a47d8dc32c6de /src/map/guild.c | |
parent | 43b44e59a86da8c2bc9103bb28ccf1cd9a86b104 (diff) | |
download | hercules-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/guild.c')
-rw-r--r-- | src/map/guild.c | 10 |
1 files changed, 7 insertions, 3 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;
|