diff options
author | panikon <panikon@zoho.com> | 2014-03-22 15:24:22 -0300 |
---|---|---|
committer | panikon <panikon@zoho.com> | 2014-03-22 15:24:22 -0300 |
commit | d097f2c4b4a31885c6b04f5868563e1f48414192 (patch) | |
tree | e0210c4c2d20a621b8224f51b49f7168f8339c4f /src | |
parent | aa120720cec6ba1ddf6ec8ac6098fef6377dddc0 (diff) | |
download | hercules-d097f2c4b4a31885c6b04f5868563e1f48414192.tar.gz hercules-d097f2c4b4a31885c6b04f5868563e1f48414192.tar.bz2 hercules-d097f2c4b4a31885c6b04f5868563e1f48414192.tar.xz hercules-d097f2c4b4a31885c6b04f5868563e1f48414192.zip |
Fixed exploit in CR_ACIDDEMONSTRATION
Fixed issue 8087
http://hercules.ws/board/tracker/issue-8087-excrescent-blank-line-in-pcc/
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 5 | ||||
-rw-r--r-- | src/map/pc.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 91db3202c..6836aa016 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3750,7 +3750,10 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * md.damage = 0; if (tsd) md.damage>>=1; #endif - if (md.damage < 0 || md.damage > INT_MAX>>1) + // Some monsters have totaldef higher than md.damage in some cases, leading to md.damage < 0 + if( md.damage < 0 ) + md.damage = 0; + if( md.damage > INT_MAX>>1 ) //Overflow prevention, will anyone whine if I cap it to a few billion? //Not capped to INT_MAX to give some room for further damage increase. md.damage = INT_MAX>>1; diff --git a/src/map/pc.c b/src/map/pc.c index a231d7226..d9b7ea7e1 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2705,9 +2705,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val) { break; case SP_ADD_VARIABLECAST: if(sd->state.lr_flag != 2) - sd->bonus.add_varcast += val; - break; #endif case SP_ADD_MONSTER_DROP_CHAINITEM: |