diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-05-01 13:56:24 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-05-01 13:56:24 +0000 |
commit | b1508637e414820d615888a11baed170392154d7 (patch) | |
tree | b7900e1469a6b03f543049af58202d5000cf2165 /src/map/mob.c | |
parent | 5524938f8650e659b3c838df44212de56bf72584 (diff) | |
download | hercules-b1508637e414820d615888a11baed170392154d7.tar.gz hercules-b1508637e414820d615888a11baed170392154d7.tar.bz2 hercules-b1508637e414820d615888a11baed170392154d7.tar.xz hercules-b1508637e414820d615888a11baed170392154d7.zip |
Replaced the integers+checking approach in r12679 with usage of floating point arithmetic.
Applied search&replace to use the new name of the function.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12680 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 7278ea043..69db21af3 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2688,7 +2688,7 @@ int mob_class_change (struct mob_data *md, int class_) if (md->class_ == class_) return 0; //Nothing to change. - hp_rate = percent(md->status.hp, md->status.max_hp); + hp_rate = get_percentage(md->status.hp, md->status.max_hp); md->class_ = class_; md->db = mob_db(class_); if (battle_config.override_mob_names==1) @@ -2823,7 +2823,7 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id) if (!battle_config.monster_class_change_recover && (skill_id == NPC_TRANSFORMATION || skill_id == NPC_METAMORPHOSIS)) - hp_rate = percent(md2->status.hp, md2->status.max_hp); + hp_rate = get_percentage(md2->status.hp, md2->status.max_hp); for(;k<amount;k++) { short x,y; @@ -2927,7 +2927,7 @@ int mob_getfriendhprate_sub(struct block_list *bl,va_list ap) if (battle_check_target(&md->bl,bl,BCT_ENEMY)>0) return 0; - rate = percent(status_get_hp(bl), status_get_max_hp(bl)); + rate = get_percentage(status_get_hp(bl), status_get_max_hp(bl)); if (rate >= min_rate && rate <= max_rate) (*fr) = bl; @@ -2954,7 +2954,7 @@ struct block_list *mob_getmasterhpltmaxrate(struct mob_data *md,int rate) if( md && md->master_id > 0 ) { struct block_list *bl = map_id2bl(md->master_id); - if( bl && percent(status_get_hp(bl), status_get_max_hp(bl)) < rate ) + if( bl && get_percentage(status_get_hp(bl), status_get_max_hp(bl)) < rate ) return bl; } @@ -3060,11 +3060,11 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) case MSC_ALWAYS: flag = 1; break; case MSC_MYHPLTMAXRATE: // HP< maxhp% - flag = percent(md->status.hp, md->status.max_hp); + flag = get_percentage(md->status.hp, md->status.max_hp); flag = (flag <= c2); break; case MSC_MYHPINRATE: - flag = percent(md->status.hp, md->status.max_hp); + flag = get_percentage(md->status.hp, md->status.max_hp); flag = (flag >= c2 && flag <= ms[i].val[0]); break; case MSC_MYSTATUSON: // status[num] on |