summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorMat <mail@mathias.is>2020-03-22 16:34:24 +0100
committerGitHub <noreply@github.com>2020-03-22 16:34:24 +0100
commit0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc (patch)
tree5792db27076c4ad881256e1fe59551442615beaf /src/Entities
parentTNT position fixes (#4519) (diff)
downloadcuberite-0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc.tar
cuberite-0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc.tar.gz
cuberite-0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc.tar.bz2
cuberite-0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc.tar.lz
cuberite-0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc.tar.xz
cuberite-0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc.tar.zst
cuberite-0b0d6b23d27217cac10cb13ebbbdb80883d2b4fc.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/EntityEffect.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Entities/EntityEffect.cpp b/src/Entities/EntityEffect.cpp
index 040513a26..1342f6098 100644
--- a/src/Entities/EntityEffect.cpp
+++ b/src/Entities/EntityEffect.cpp
@@ -373,7 +373,7 @@ void cEntityEffectRegeneration::OnTick(cPawn & a_Target)
}
// Regen frequency = 50 ticks, divided by potion level (Regen II = 25 ticks)
- int frequency = FloorC(50.0 / static_cast<double>(m_Intensity + 1));
+ int frequency = std::max(1, FloorC(50.0 / static_cast<double>(m_Intensity + 1)));
if ((m_Ticks % frequency) != 0)
{
@@ -462,7 +462,7 @@ void cEntityEffectPoison::OnTick(cPawn & a_Target)
}
// Poison frequency = 25 ticks, divided by potion level (Poison II = 12 ticks)
- int frequency = FloorC(25.0 / static_cast<double>(m_Intensity + 1));
+ int frequency = std::max(1, FloorC(25.0 / static_cast<double>(m_Intensity + 1)));
if ((m_Ticks % frequency) == 0)
{
@@ -486,7 +486,7 @@ void cEntityEffectWither::OnTick(cPawn & a_Target)
super::OnTick(a_Target);
// Damage frequency = 40 ticks, divided by effect level (Wither II = 20 ticks)
- int frequency = FloorC(25.0 / static_cast<double>(m_Intensity + 1));
+ int frequency = std::max(1, FloorC(40.0 / static_cast<double>(m_Intensity + 1)));
if ((m_Ticks % frequency) == 0)
{