summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/battle.c5
-rw-r--r--src/map/pc.c2
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: