Ver código fonte

Fixed negative `fixed cast time` should never reduce cast time. Thank @reigneil

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
Cydh Ramdh 9 anos atrás
pai
commit
2e4b499d5c
1 arquivos alterados com 5 adições e 3 exclusões
  1. 5 3
      src/map/skill.c

+ 5 - 3
src/map/skill.c

@@ -15866,15 +15866,17 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
 			fixed = 0;
 	}
 
+#undef FIXEDCASTRATE2
+
 	// Apply Variable CastTime calculation by INT & DEX
 	if (!(flag&1))
 		time = time * (1 - sqrt(((float)(status_get_dex(bl)*2 + status_get_int(bl)) / battle_config.vcast_stat_scale)));
 
 	// Apply Fixed CastTime rate
-	if (fixed != 0 && fixcast_r != 0)
+	if (fixed != 0 && fixcast_r != 0) {
 		fixed = (int)(fixed * (1 + fixcast_r * 0.01));
-
-#undef FIXEDCASTRATE2
+		fixed = max(fixed, 0);
+	}
 
 	return (int)max(time + fixed, 0);
 }