summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-02-09 20:26:42 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-02-09 20:26:42 +0000
commit0034a439b74142f27a93b422ef66eaa90ddb7ab3 (patch)
tree560d2c8f405398602ab425d3c97ab3acd3c96d65 /src/map/guild.c
parent321fad2e5e3ceff3f624d124565b22ca9868db9f (diff)
downloadhercules-0034a439b74142f27a93b422ef66eaa90ddb7ab3.tar.gz
hercules-0034a439b74142f27a93b422ef66eaa90ddb7ab3.tar.bz2
hercules-0034a439b74142f27a93b422ef66eaa90ddb7ab3.tar.xz
hercules-0034a439b74142f27a93b422ef66eaa90ddb7ab3.zip
Expanded range for cached and stored-in-db guild member exp (devotion) from uint32 to uint64. (bugreport:3983)
Capped value when sending to client to INT_MAX to prevent confusion. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14242 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index e7b9f4096..8cb263a87 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -48,7 +48,7 @@ struct eventlist {
// ギルドのEXPキャッシュ
struct guild_expcache {
int guild_id, account_id, char_id;
- unsigned int exp;
+ uint64 exp;
};
static struct eri *expcache_ers; //For handling of guild exp payment.
@@ -343,8 +343,8 @@ int guild_payexp_timer_sub(DBKey dataid, void *data, va_list ap)
return 0;
}
- if (g->member[i].exp > UINT_MAX - c->exp)
- g->member[i].exp = UINT_MAX;
+ if (g->member[i].exp > UINT64_MAX - c->exp)
+ g->member[i].exp = UINT64_MAX;
else
g->member[i].exp+= c->exp;
@@ -1193,13 +1193,13 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
if (per < 100)
- exp = (unsigned int) exp * per / 100;
+ exp = exp * per / 100;
//Otherwise tax everything.
c = (struct guild_expcache*)guild_expcache_db->ensure(guild_expcache_db, i2key(sd->status.char_id), create_expcache, sd);
- if (c->exp > UINT_MAX - exp)
- c->exp = UINT_MAX;
+ if (c->exp > UINT64_MAX - exp)
+ c->exp = UINT64_MAX;
else
c->exp += exp;
@@ -1217,8 +1217,8 @@ int guild_getexp(struct map_session_data *sd,int exp)
return 0;
c = (struct guild_expcache*)guild_expcache_db->ensure(guild_expcache_db, i2key(sd->status.char_id), create_expcache, sd);
- if (c->exp > UINT_MAX - exp)
- c->exp = UINT_MAX;
+ if (c->exp > UINT64_MAX - exp)
+ c->exp = UINT64_MAX;
else
c->exp += exp;
return exp;