diff options
author | Tycho <work.tycho+git@gmail.com> | 2015-01-16 14:13:23 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2015-01-16 14:13:23 +0100 |
commit | d6f042da4a4d296ab9be18884996f0d88dd23c39 (patch) | |
tree | 973acabf70943bbe7114cd000881ccb60d7a041f | |
parent | Fix trailing whitespace (diff) | |
download | cuberite-d6f042da4a4d296ab9be18884996f0d88dd23c39.tar cuberite-d6f042da4a4d296ab9be18884996f0d88dd23c39.tar.gz cuberite-d6f042da4a4d296ab9be18884996f0d88dd23c39.tar.bz2 cuberite-d6f042da4a4d296ab9be18884996f0d88dd23c39.tar.lz cuberite-d6f042da4a4d296ab9be18884996f0d88dd23c39.tar.xz cuberite-d6f042da4a4d296ab9be18884996f0d88dd23c39.tar.zst cuberite-d6f042da4a4d296ab9be18884996f0d88dd23c39.zip |
-rw-r--r-- | src/Entities/ArrowEntity.cpp | 10 | ||||
-rw-r--r-- | src/Entities/ArrowEntity.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp index 2ec825ddb..0fbbfb681 100644 --- a/src/Entities/ArrowEntity.cpp +++ b/src/Entities/ArrowEntity.cpp @@ -177,17 +177,17 @@ void cArrowEntity::CollectedBy(cPlayer & a_Dest) void cArrowEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { super::Tick(a_Dt, a_Chunk); - m_Timer += a_Dt.count(); + m_Timer += a_Dt; if (m_bIsCollected) { - if (m_Timer > 500.f) // 0.5 seconds + if (m_Timer > std::chrono::milliseconds(500)) { Destroy(); return; } } - else if (m_Timer > 1000 * 60 * 5) // 5 minutes + else if (m_Timer > std::chrono::minutes(5)) { Destroy(); return; @@ -202,14 +202,14 @@ void cArrowEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) if (!m_HasTeleported) // Sent a teleport already, don't do again { - if (m_HitGroundTimer > 500.f) // Send after half a second, could be less, but just in case + if (m_HitGroundTimer > std::chrono::milliseconds(500)) { m_World->BroadcastTeleportEntity(*this); m_HasTeleported = true; } else { - m_HitGroundTimer += a_Dt.count(); + m_HitGroundTimer += a_Dt; } } diff --git a/src/Entities/ArrowEntity.h b/src/Entities/ArrowEntity.h index 8c92049b0..2ecc16d1c 100644 --- a/src/Entities/ArrowEntity.h +++ b/src/Entities/ArrowEntity.h @@ -85,10 +85,10 @@ protected: bool m_IsCritical; /** Timer for pickup collection animation or five minute timeout */ - float m_Timer; + std::chrono::milliseconds m_Timer; /** Timer for client arrow position confirmation via TeleportEntity */ - float m_HitGroundTimer; + std::chrono::milliseconds m_HitGroundTimer; // Whether the arrow has already been teleported into the proper position in the ground. bool m_HasTeleported; |