summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-01 19:51:43 +0200
committerLukas Pioch <lukas@zgow.de>2017-08-03 15:34:38 +0200
commit79eb4c3aed59edce58d2529bf9c6334f7fe6fbad (patch)
tree1c572f4c9939968abbcb3ec6b9d6d9630b1f900a /src/Entities/Player.cpp
parentRemove double includes part 2 (#3890) (diff)
downloadcuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.gz
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.bz2
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.lz
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.xz
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.zst
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.zip
Diffstat (limited to '')
-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;