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/pet.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/pet.c')
-rw-r--r-- | src/map/pet.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/pet.c b/src/map/pet.c index d06155b54..b8a61e093 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -554,7 +554,7 @@ int pet_catch_process2(struct map_session_data* sd, int target_id) return 1; } - pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - md->level)*30 + sd->battle_status.luk*20)*(200 - percent(md->status.hp, md->status.max_hp))/100; + pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - md->level)*30 + sd->battle_status.luk*20)*(200 - get_percentage(md->status.hp, md->status.max_hp))/100; if(pet_catch_rate < 1) pet_catch_rate = 1; if(battle_config.pet_catch_rate != 100) @@ -1162,8 +1162,8 @@ int pet_heal_timer(int tid, unsigned int tick, int id, intptr data) status = status_get_status_data(&sd->bl); if(pc_isdead(sd) || - (rate = percent(status->sp, status->max_sp)) > pd->s_skill->sp || - (rate = percent(status->hp, status->max_hp)) > pd->s_skill->hp || + (rate = get_percentage(status->sp, status->max_sp)) > pd->s_skill->sp || + (rate = get_percentage(status->hp, status->max_hp)) > pd->s_skill->hp || (rate = (pd->ud.skilltimer != -1)) //Another skill is in effect ) { //Wait (how long? 1 sec for every 10% of remaining) pd->s_skill->timer=add_timer(gettick()+(rate>10?rate:10)*100,pet_heal_timer,sd->bl.id,0); @@ -1205,8 +1205,8 @@ int pet_skill_support_timer(int tid, unsigned int tick, int id, intptr data) } if(pc_isdead(sd) || - (rate = percent(status->sp, status->max_sp)) > pd->s_skill->sp || - (rate = percent(status->hp, status->max_hp)) > pd->s_skill->hp || + (rate = get_percentage(status->sp, status->max_sp)) > pd->s_skill->sp || + (rate = get_percentage(status->hp, status->max_hp)) > pd->s_skill->hp || (rate = (pd->ud.skilltimer != -1)) //Another skill is in effect ) { //Wait (how long? 1 sec for every 10% of remaining) pd->s_skill->timer=add_timer(tick+(rate>10?rate:10)*100,pet_skill_support_timer,sd->bl.id,0); |