diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2019-12-30 17:00:18 +0100 |
---|---|---|
committer | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-02-05 00:35:56 +0100 |
commit | 76c0b6cee70d9c2a382f6479b34a615f38d02be1 (patch) | |
tree | fe9698522a80418c031a0dbc434a3ac03d37d310 /src/char | |
parent | 09ca47a3174082b07b95728f54bf53528cb58c49 (diff) | |
download | hercules-76c0b6cee70d9c2a382f6479b34a615f38d02be1.tar.gz hercules-76c0b6cee70d9c2a382f6479b34a615f38d02be1.tar.bz2 hercules-76c0b6cee70d9c2a382f6479b34a615f38d02be1.tar.xz hercules-76c0b6cee70d9c2a382f6479b34a615f38d02be1.zip |
Updated inter_party_check_lv() function.
* Improved assignment of p->min_lv and p->max_lv.
* Removed unnecessary lv variable.
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/int_party.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c index 53243e821..c8c18ce7f 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -46,10 +46,9 @@ struct inter_party_interface *inter_party; static int inter_party_check_lv(struct party_data *p) { int i; - unsigned int lv; nullpo_ret(p); - p->min_lv = UINT_MAX; - p->max_lv = 0; + p->min_lv = MAX_LEVEL; + p->max_lv = 1; for(i=0;i<MAX_PARTY;i++){ /** * - If not online OR if it's a family party and this is the child (doesn't affect exp range) @@ -57,9 +56,8 @@ static int inter_party_check_lv(struct party_data *p) if(!p->party.member[i].online || p->party.member[i].char_id == p->family ) continue; - lv=p->party.member[i].lv; - if (lv < p->min_lv) p->min_lv = lv; - if (lv > p->max_lv) p->max_lv = lv; + p->min_lv = min(p->min_lv, p->party.member[i].lv); + p->max_lv = max(p->max_lv, p->party.member[i].lv); } if (p->party.exp && !inter_party->check_exp_share(p)) { |