summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index b07f23958..3bbe334fb 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -2963,15 +2963,17 @@ float cPlayer::GetDigSpeed(BLOCKTYPE a_Block)
}
}
- if (HasEntityEffect(cEntityEffect::effHaste))
+ auto Haste = GetEntityEffect(cEntityEffect::effHaste);
+ if (Haste != nullptr)
{
- int intensity = GetEntityEffect(cEntityEffect::effHaste)->GetIntensity() + 1;
+ int intensity = Haste->GetIntensity() + 1;
f *= 1.0f + (intensity * 0.2f);
}
- if (HasEntityEffect(cEntityEffect::effMiningFatigue))
+ auto MiningFatigue = GetEntityEffect(cEntityEffect::effMiningFatigue);
+ if (MiningFatigue != nullptr)
{
- int intensity = GetEntityEffect(cEntityEffect::effMiningFatigue)->GetIntensity();
+ int intensity = MiningFatigue->GetIntensity();
switch (intensity)
{
case 0: f *= 0.3f; break;