diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-22 16:52:46 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-22 16:52:46 +0000 |
commit | 808b216c7dd6fedf644a0992dbb86255aed1068d (patch) | |
tree | 15405273f97bae2f965bca6bacc04e49b82220b2 /src/map/intif.c | |
parent | b561fcc8037f50a9f562f2bcaa2b6d8e4644bcc4 (diff) | |
download | hercules-808b216c7dd6fedf644a0992dbb86255aed1068d.tar.gz hercules-808b216c7dd6fedf644a0992dbb86255aed1068d.tar.bz2 hercules-808b216c7dd6fedf644a0992dbb86255aed1068d.tar.xz hercules-808b216c7dd6fedf644a0992dbb86255aed1068d.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/branches/renewal@14487 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 19 |
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; } |