diff options
author | Haru <haru@dotalux.com> | 2015-01-20 04:36:08 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-01-20 04:41:33 +0100 |
commit | 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch) | |
tree | dab9d12a6a4b95a37598e27e6e86d6047360d61b /src/char/int_guild.c | |
parent | 03709c136ad300be631adfd38dc36c2433bda718 (diff) | |
download | hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2 hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip |
Minor fixes and tweaks suggested by cppcheck
- Variable scopes reduced
- Parenthesized ambiguous expressions
- Removed or added NULL checks where (un)necessary
- Corrected format strings
- Fixed typos potentially leading to bugs
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r-- | src/char/int_guild.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 7af01f883..20db452af 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -220,14 +220,12 @@ int inter_guild_tosql(struct guild *g,int flag) StrBuf->Destroy(&buf); } - if (flag&GS_MEMBER) - { - struct guild_member *m; + if (flag&GS_MEMBER) { strcat(t_info, " members"); // Update only needed players for(i=0;i<g->max_member;i++){ - m = &g->member[i]; + struct guild_member *m = &g->member[i]; if (!m->modified) continue; if(m->account_id) { @@ -1509,12 +1507,11 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int } case GMI_EXP: { - uint64 exp, old_exp=g->member[i].exp; + uint64 old_exp = g->member[i].exp; g->member[i].exp=*((uint64 *)data); g->member[i].modified = GS_MEMBER_MODIFIED; - if (g->member[i].exp > old_exp) - { - exp = g->member[i].exp - old_exp; + if (g->member[i].exp > old_exp) { + uint64 exp = g->member[i].exp - old_exp; // Compute gained exp if (guild_exp_rate != 100) |