diff options
author | shennetsind <ind@henn.et> | 2014-03-14 13:41:49 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-03-14 13:41:49 -0300 |
commit | 2cc2a97b574a9485394c6da315b38b9cf362c277 (patch) | |
tree | a46d1ca0b138d7973e847e57b7234919b0f69d64 /src/map/pc.c | |
parent | f4b1ff7426b1c4cd5e8cac37f7e3983cc03c706e (diff) | |
parent | 1849d357210bc3d01be99e1a7cd5e8c19e5d53f4 (diff) | |
download | hercules-2cc2a97b574a9485394c6da315b38b9cf362c277.tar.gz hercules-2cc2a97b574a9485394c6da315b38b9cf362c277.tar.bz2 hercules-2cc2a97b574a9485394c6da315b38b9cf362c277.tar.xz hercules-2cc2a97b574a9485394c6da315b38b9cf362c277.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 5eb682415..41a722dfb 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -7521,7 +7521,7 @@ void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int ty *------------------------------------------*/ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) { - int bonus; + int bonus, tmp; if(hp) { int i; @@ -7541,8 +7541,10 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) break; } } - if(bonus!=100) - hp = hp * bonus / 100; + + tmp = hp*bonus/100; + if(bonus != 100 && tmp > hp) + hp = tmp; // Recovery Potion if( sd->sc.data[SC_HEALPLUS] ) @@ -7554,8 +7556,10 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) + pc->checkskill(sd,AM_LEARNINGPOTION)*5; if (script->potion_flag > 1) bonus += bonus*(script->potion_flag-1)*50/100; - if(bonus != 100) - sp = sp * bonus / 100; + + tmp = sp*bonus/100; + if(bonus != 100 && tmp > sp) + sp = tmp; } if( sd->sc.count ) { if ( sd->sc.data[SC_CRITICALWOUND] ) { |