aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-06-20 08:16:25 +0200
committerGiacomo Pozzoni <giacomopoz@gmail.com>2019-06-20 08:16:25 +0200
commit9083fc149d61f9f2ee8fe760ece4392b1e8b181e (patch)
tree57a9b35d2ae321d6b6bd84128ae93e0c5ed52398 /src
parent4320cd7d375927f1008824d6ddf8cc7d212d4ed2 (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)
Diffstat (limited to 'src')
-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 b50be84b7d2..a5b16142c89 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4898,15 +4898,15 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
// 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_SUMMONING_RITUAL: