Skip to content

Instantly share code, notes, and snippets.

@mackal
Created July 9, 2014 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mackal/0cf53d94e6762c15e481 to your computer and use it in GitHub Desktop.
Save mackal/0cf53d94e6762c15e481 to your computer and use it in GitHub Desktop.
stdin
diff --git a/zone/mob.cpp b/zone/mob.cpp
index 340dfdf..bc695ac 100644
--- a/zone/mob.cpp
+++ b/zone/mob.cpp
@@ -4726,26 +4726,22 @@ bool Mob::PassLimitToSkill(uint16 spell_id, uint16 skill) {
return false;
}
-uint16 Mob::GetWeaponSpeedbyHand(uint16 hand) {
-
- uint16 weapon_speed = 0;
+uint16 Mob::GetWeaponSpeedbyHand(uint16 hand)
+{
+ uint16 weapon_speed = RuleI(Combat, MinHastedDelay);
switch (hand) {
-
case 13:
- weapon_speed = attack_timer.GetDuration();
- break;
+ return std::max(weapon_speed,
+ static_cast<uint16>(attack_timer.GetDuration()));
case 14:
- weapon_speed = attack_dw_timer.GetDuration();
- break;
+ return std::max(weapon_speed,
+ static_cast<uint16>(attack_dw_timer.GetDuration()));
case 11:
- weapon_speed = ranged_timer.GetDuration();
- break;
+ return std::max(weapon_speed,
+ static_cast<uint16>(ranged_timer.GetDuration()));
+ default:
+ return weapon_speed;
}
-
- if (weapon_speed < RuleI(Combat, MinHastedDelay))
- weapon_speed = RuleI(Combat, MinHastedDelay);
-
- return weapon_speed;
}
int8 Mob::GetDecayEffectValue(uint16 spell_id, uint16 spelleffect) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment