summaryrefslogtreecommitdiff
path: root/src/char/int_party.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-20 04:36:08 +0100
committerHaru <haru@dotalux.com>2015-01-20 04:41:33 +0100
commit4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch)
treedab9d12a6a4b95a37598e27e6e86d6047360d61b /src/char/int_party.c
parent03709c136ad300be631adfd38dc36c2433bda718 (diff)
downloadhercules-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_party.c')
-rw-r--r--src/char/int_party.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index b16f106be..bf950ec42 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -54,7 +54,6 @@ static int inter_party_check_lv(struct party_data *p) {
static void inter_party_calc_state(struct party_data *p)
{
int i;
- unsigned int lv;
p->min_lv = UINT_MAX;
p->max_lv = 0;
p->party.count =
@@ -83,13 +82,12 @@ static void inter_party_calc_state(struct party_data *p)
);
}
//max/min levels.
- for(i=0;i<MAX_PARTY;i++){
- lv=p->party.member[i].lv;
+ for (i = 0; i < MAX_PARTY; i++) {
+ unsigned int lv = p->party.member[i].lv;
if (!lv) continue;
- if(p->party.member[i].online &&
- //On families, the kid is not counted towards exp share rules.
- p->party.member[i].char_id != p->family)
- {
+ if (p->party.member[i].online
+ && p->party.member[i].char_id != p->family /* In families, the kid is not counted towards exp share rules. */
+ ) {
if( lv < p->min_lv ) p->min_lv=lv;
if( p->max_lv < lv ) p->max_lv=lv;
}