fix(Code/Fishing): improve timing of fishing (#4733)

This commit is contained in:
Stefano Borzì
2021-03-07 13:13:29 +01:00
committed by GitHub
parent 9a3ae2e4dc
commit 7988717eef

View File

@@ -5497,7 +5497,7 @@ 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;
@@ -5508,12 +5508,11 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
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: