summaryrefslogtreecommitdiff
path: root/src/char/int_guild.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r--src/char/int_guild.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 3cd5572d9..a676de285 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -4,6 +4,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include "../common/mmo.h"
#include "../common/socket.h"
@@ -1205,12 +1206,21 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
g->member[i].position = *((int *)data);
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);
+ {
+ 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);
+ }
break;
}
case GMI_HAIR: