summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Player.cpp6
-rw-r--r--src/Entities/TNTEntity.cpp8
-rw-r--r--src/Entities/TNTEntity.h2
3 files changed, 10 insertions, 6 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index d0d729567..6d92eff6a 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -3232,17 +3232,17 @@ float cPlayer::GetMiningProgressPerTick(BLOCKTYPE a_Block)
ASSERT(BlockHardness > 0); // Can't divide by 0 or less, IsOneHitDig should have returned true
if (GetEquippedItem().GetHandler()->CanHarvestBlock(a_Block))
{
- BlockHardness*=1.5;
+ BlockHardness *= 1.5f;
}
else
{
- BlockHardness*=5;
+ BlockHardness *= 5.0f;
}
float DigSpeed = GetDigSpeed(a_Block);
// LOGD("Time to mine block = %f", BlockHardness/DigSpeed);
// Number of ticks to mine = (20 * BlockHardness)/DigSpeed;
// Therefore take inverse to get fraction mined per tick:
- return DigSpeed / (20 * BlockHardness);
+ return DigSpeed / (20.0f * BlockHardness);
}
diff --git a/src/Entities/TNTEntity.cpp b/src/Entities/TNTEntity.cpp
index 6aea6e228..ef013c347 100644
--- a/src/Entities/TNTEntity.cpp
+++ b/src/Entities/TNTEntity.cpp
@@ -58,8 +58,12 @@ void cTNTEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
BroadcastMovementUpdate();
- m_FuseTicks -= 1;
- if (m_FuseTicks <= 0)
+ if (m_FuseTicks > 0)
+ {
+ --m_FuseTicks;
+ }
+
+ if (m_FuseTicks == 0)
{
Explode();
}
diff --git a/src/Entities/TNTEntity.h b/src/Entities/TNTEntity.h
index 5b1c853bd..d181eee22 100644
--- a/src/Entities/TNTEntity.h
+++ b/src/Entities/TNTEntity.h
@@ -39,5 +39,5 @@ public: // tolua_export
// tolua_end
protected:
- int m_FuseTicks; ///< How much ticks is left, while the tnt will explode
+ unsigned m_FuseTicks; ///< How much ticks is left, while the tnt will explode
}; // tolua_export