Sfoglia il codice sorgente

Fixes skill cooldown adjustment from items (#5950)

* Fixes #5934.
* Items that adjust cooldown will now not return 0 if no cooldown is defined for a skill.
Thanks to @Felleonel!
Aleos 4 anni fa
parent
commit
202f37c2fc
1 ha cambiato i file con 3 aggiunte e 6 eliminazioni
  1. 3 6
      src/map/pc.cpp

+ 3 - 6
src/map/pc.cpp

@@ -6354,20 +6354,17 @@ int pc_get_skillcooldown(struct map_session_data *sd, uint16 skill_id, uint16 sk
 
 	int cooldown = skill_get_cooldown(skill_id, skill_lv);
 
-	if (cooldown == 0)
-		return 0;
-
-	if (skill_id == SU_TUNABELLY && pc_checkskill(sd, SU_SPIRITOFSEA))
+	if (skill_id == SU_TUNABELLY && pc_checkskill(sd, SU_SPIRITOFSEA) > 0)
 		cooldown -= skill_get_time(SU_TUNABELLY, skill_lv);
 
 	for (auto &it : sd->skillcooldown) {
 		if (it.id == skill_id) {
 			cooldown += it.val;
-			cooldown = max(0, cooldown);
 			break;
 		}
 	}
-	return cooldown;
+
+	return max(0, cooldown);
 }
 
 /*==========================================