From 6bd0769c68ca86c5454a360f46d0facbbc75cfe5 Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 9 Jun 2006 15:12:53 +0000 Subject: - 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 --- src/map/guild.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'src/map/guild.c') 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 -- cgit v1.2.3-70-g09d2