summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2015-01-11 22:12:26 +0100
committerTycho <work.tycho+git@gmail.com>2015-01-11 22:12:26 +0100
commit2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce (patch)
tree86e5b6b66d4791bd64485313db23d7f281f59ab5 /src/Mobs/Monster.cpp
parentCreated new type cTickTime and rewrote cWorld::TickThread to use it (diff)
downloadcuberite-2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce.tar
cuberite-2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce.tar.gz
cuberite-2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce.tar.bz2
cuberite-2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce.tar.lz
cuberite-2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce.tar.xz
cuberite-2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce.tar.zst
cuberite-2a9664d6ca8aa9eb4f554301e4d9b0ec33b465ce.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 425c80bf4..30bbd0ff2 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -252,14 +252,14 @@ bool cMonster::ReachedFinalDestination()
-void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
+void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
if (m_Health <= 0)
{
// The mob is dead, but we're still animating the "puff" they leave when they die
- m_DestroyTimer += a_Dt / 1000;
+ m_DestroyTimer += a_Dt.count() / 1000;
if (m_DestroyTimer > 1)
{
Destroy(true);
@@ -275,8 +275,6 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
// Burning in daylight
HandleDaylightBurning(a_Chunk);
- a_Dt /= 1000;
-
if (m_bMovingToDestination)
{
if (m_bOnGround)
@@ -347,18 +345,18 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
case IDLE:
{
// If enemy passive we ignore checks for player visibility
- InStateIdle(a_Dt);
+ InStateIdle(std::chrono::duration_cast<std::chrono::seconds>(a_Dt).count());
break;
}
case CHASING:
{
// If we do not see a player anymore skip chasing action
- InStateChasing(a_Dt);
+ InStateChasing(std::chrono::duration_cast<std::chrono::seconds>(a_Dt).count());
break;
}
case ESCAPING:
{
- InStateEscaping(a_Dt);
+ InStateEscaping(std::chrono::duration_cast<std::chrono::seconds>(a_Dt).count());
break;
}