summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-22 16:52:46 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-22 16:52:46 +0000
commit2a3ca1bcfa82023b3f890f19775b115e8a744b88 (patch)
tree589420d27d8276eb70e90fd686ac92385830965a /src/map/intif.c
parent873717f2814a890f5b8c52f0302d6cd67e3e29f6 (diff)
downloadhercules-2a3ca1bcfa82023b3f890f19775b115e8a744b88.tar.gz
hercules-2a3ca1bcfa82023b3f890f19775b115e8a744b88.tar.bz2
hercules-2a3ca1bcfa82023b3f890f19775b115e8a744b88.tar.xz
hercules-2a3ca1bcfa82023b3f890f19775b115e8a744b88.zip
* Fixed guild and guild member exp truncation issue (bugreport:4130, since r14242).
- Fixed guild member position, hair, hair color, gender, class and level could potentially become corrupted due to shorts being read as ints (partially since r2986). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14487 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index c8aad3807..ba5230bab 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -1124,7 +1124,7 @@ int intif_parse_GuildBasicInfoChanged(int fd)
return 0;
switch(type) {
- case GBI_EXP: g->exp = RFIFOL(fd,10); break;
+ case GBI_EXP: g->exp = RFIFOQ(fd,10); break;
case GBI_GUILDLV: g->guild_lv = RFIFOW(fd,10); break;
case GBI_SKILLPOINT: g->skill_point = RFIFOL(fd,10); break;
}
@@ -1141,8 +1141,7 @@ int intif_parse_GuildMemberInfoChanged(int fd)
int account_id = RFIFOL(fd,8);
int char_id = RFIFOL(fd,12);
int type = RFIFOW(fd,16);
- void* data = RFIFOP(fd,18);
- int dd = *((int *)data);
+ //void* data = RFIFOP(fd,18);
struct guild* g;
int idx;
@@ -1156,13 +1155,13 @@ int intif_parse_GuildMemberInfoChanged(int fd)
return 0;
switch( type ) {
- case GMI_POSITION: g->member[idx].position = dd; guild_memberposition_changed(g,idx,dd); break;
- case GMI_EXP: g->member[idx].exp = dd; break;
- case GMI_HAIR: g->member[idx].hair = dd; break;
- case GMI_HAIR_COLOR: g->member[idx].hair_color = dd; break;
- case GMI_GENDER: g->member[idx].gender = dd; break;
- case GMI_CLASS: g->member[idx].class_ = dd; break;
- case GMI_LEVEL: g->member[idx].lv = dd; break;
+ case GMI_POSITION: g->member[idx].position = RFIFOW(fd,18); guild_memberposition_changed(g,idx,RFIFOW(fd,18)); break;
+ case GMI_EXP: g->member[idx].exp = RFIFOQ(fd,18); break;
+ case GMI_HAIR: g->member[idx].hair = RFIFOW(fd,18); break;
+ case GMI_HAIR_COLOR: g->member[idx].hair_color = RFIFOW(fd,18); break;
+ case GMI_GENDER: g->member[idx].gender = RFIFOW(fd,18); break;
+ case GMI_CLASS: g->member[idx].class_ = RFIFOW(fd,18); break;
+ case GMI_LEVEL: g->member[idx].lv = RFIFOW(fd,18); break;
}
return 0;
}