aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-06-20 08:16:25 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-11 16:18:57 +0100
commit07dcb28f80b958e7dd5784a074f7ed013527d92f (patch)
tree27015b142d2857809fe1cdfc1baa5f0f927632ed
parentbfef73b5102201e85a31b39ae595da42d9750c7e (diff)
Spell/Fishing: ensure that the fishing bobber expires when the Fishing channeling ends, and don't allow fish to be hooked in the instant the spell is cast. (#23448)
(cherry picked from commit 9083fc149d61f9f2ee8fe760ece4392b1e8b181e)
-rw-r--r--src/server/game/Spells/SpellEffects.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index b4028e41615..888eac444f4 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4553,15 +4553,15 @@ void Spell::EffectTransmitted()
// end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo))
// start time == fish-FISHING_BOBBER_READY_TIME (0..GetDuration(m_spellInfo)-FISHING_BOBBER_READY_TIME)
int32 lastSec = 0;
- switch (urand(0, 3))
+ switch (urand(0, 2))
{
case 0: lastSec = 3; break;
case 1: lastSec = 7; break;
case 2: lastSec = 13; break;
- case 3: lastSec = 17; break;
}
- duration = duration - lastSec*IN_MILLISECONDS + FISHING_BOBBER_READY_TIME*IN_MILLISECONDS;
+ // Duration of the fishing bobber can't be higher than the Fishing channeling duration
+ duration = std::min(duration, duration - lastSec*IN_MILLISECONDS + FISHING_BOBBER_READY_TIME*IN_MILLISECONDS);
break;
}
case GAMEOBJECT_TYPE_RITUAL: