diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 15:12:53 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-09 15:12:53 +0000 |
commit | 6bd0769c68ca86c5454a360f46d0facbbc75cfe5 (patch) | |
tree | 91bffd583777704b9ebb1d00e2831ea2faed59eb /src/char_sql/int_guild.c | |
parent | 8711b3099048ccacaa84f52fef06e4c6ded4aa4b (diff) | |
download | hercules-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/char_sql/int_guild.c')
-rw-r--r-- | src/char_sql/int_guild.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index f0ee8be4d..23cb95bb7 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -7,6 +7,7 @@ #include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include "char.h"
#include "../common/strlib.h"
@@ -1523,16 +1524,26 @@ int mapif_parse_GuildMemberInfoChange(int fd,int guild_id,int account_id,int cha break;
}
case GMI_EXP:
- { // EXP
- unsigned int exp,oldexp=g->member[i].exp;
- exp=g->member[i].exp=*((unsigned int *)data);
- g->exp+=(exp-oldexp);
- guild_calcinfo(g); // LvƒAƒbƒv”»’f
- mapif_guild_basicinfochanged(guild_id,GBI_EXP,&g->exp,4);
- mapif_guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
- g->save_flag |= (GS_BASIC|GS_MEMBER);
- break;
- }
+ { // EXP
+ unsigned int exp, old_exp=g->member[i].exp;
+ g->member[i].exp=*((unsigned int *)data);
+ if (g->member[i].exp > old_exp)
+ {
+ exp = g->member[i].exp - old_exp;
+ if (guild_exp_rate != 100)
+ exp = exp*guild_exp_rate/100;
+ if (exp > UINT_MAX - g->exp)
+ g->exp = UINT_MAX;
+ else
+ g->exp+=exp;
+ guild_calcinfo(g);
+ mapif_guild_basicinfochanged(guild_id,GBI_EXP,&g->exp,4);
+ g->save_flag |= GS_BASIC;
+ }
+ mapif_guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
+ g->save_flag |= GS_MEMBER;
+ break;
+ }
case GMI_HAIR:
{
g->member[i].hair=*((int *)data);
|