summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-09 15:12:53 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-09 15:12:53 +0000
commit6bd0769c68ca86c5454a360f46d0facbbc75cfe5 (patch)
tree91bffd583777704b9ebb1d00e2831ea2faed59eb /src/map/guild.c
parent8711b3099048ccacaa84f52fef06e4c6ded4aa4b (diff)
downloadhercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.tar.gz
hercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.tar.bz2
hercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.tar.xz
hercules-6bd0769c68ca86c5454a360f46d0facbbc75cfe5.zip
- Fixed @mapinfo displaying incorrectly maps with nosave which send you back to your last savepoint.
- Moved guild_exp_rate from a mapserver battle config setting to a char server config. It no longer modifies the total taxed exp as seen on the guild information window, but directly modifies the exp that the guild earns. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7074 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index bef4f0c31..8e4a16901 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -1141,8 +1141,6 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
struct guild *g;
struct guild_expcache *c;
int per;
- unsigned int exp2;
- double tmp;
nullpo_retr(0, sd);
@@ -1150,32 +1148,23 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
if (sd->status.guild_id == 0 ||
(g = guild_search(sd->status.guild_id)) == NULL ||
- (per = g->position[guild_getposition(sd,g)].exp_mode) <= 0)
+ (per = guild_getposition(sd,g)) < 0 ||
+ (per = g->position[per].exp_mode) < 1)
return 0;
- if (per > 100) per = 100;
- else
- if (per < 1) return 0;
-
-
- tmp = exp * per / 100;
- if (tmp <= 0)
- return 0;
-
- exp2 = (unsigned int)tmp;
+ if (per < 100)
+ exp = (unsigned int) exp * per / 100;
+ //Otherwise tax everything.
- if (battle_config.guild_exp_rate != 100)
- tmp = tmp*battle_config.guild_exp_rate/100;
-
c = guild_expcache_db->ensure(guild_expcache_db, i2key(sd->status.char_id), create_expcache, sd);
- if (c->exp > UINT_MAX - (unsigned int)tmp)
+ if (c->exp > UINT_MAX - exp)
c->exp = UINT_MAX;
else
- c->exp += (unsigned int)tmp;
+ c->exp += exp;
- return exp2;
+ return exp;
}
// Celest