diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-05-01 12:14:06 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-05-01 12:14:06 +0000 |
commit | 5524938f8650e659b3c838df44212de56bf72584 (patch) | |
tree | 9696c2ef858b4ebd81eda804389f8ece788a994b /src/map/skill.c | |
parent | 3bba210cc5151bfc2971be296ab5c4391ea28639 (diff) | |
download | hercules-5524938f8650e659b3c838df44212de56bf72584.tar.gz hercules-5524938f8650e659b3c838df44212de56bf72584.tar.bz2 hercules-5524938f8650e659b3c838df44212de56bf72584.tar.xz hercules-5524938f8650e659b3c838df44212de56bf72584.zip |
Implemented get_percentage() for compact and safe calculation of percentual values.
Fixed integer arithmetic overflows that were occuring in several supernovice checks (bugreport:1135).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12679 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index ce842e734..f8f50e3aa 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7582,7 +7582,7 @@ int skill_check_condition(struct map_session_data* sd, short skill, short lv, in itemid[i] = skill_db[j].itemid[i]; amount[i] = skill_db[j].amount[i]; } - if(mhp > 0 && status_calc_life(status->hp, status->max_hp) > mhp) { + if(mhp > 0 && percent(status->hp, status->max_hp) > mhp) { //mhp is the max-hp-requirement, that is, //you must have this % or less of HP to cast it. clif_skill_fail(sd,skill,2,0); |