summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/MobSpawnerEntity.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-04-05 02:38:43 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-04-12 23:35:07 +0200
commit4cd49d7eca5f8fd53eb98577a1f218a5086704bb (patch)
tree09bf29a1d30a37445796ed70867f934435c4261f /src/BlockEntities/MobSpawnerEntity.cpp
parentFixed generator for the Mega Taiga biome (#5129) (diff)
downloadcuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.gz
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.bz2
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.lz
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.xz
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.zst
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.zip
Diffstat (limited to 'src/BlockEntities/MobSpawnerEntity.cpp')
-rw-r--r--src/BlockEntities/MobSpawnerEntity.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/BlockEntities/MobSpawnerEntity.cpp b/src/BlockEntities/MobSpawnerEntity.cpp
index 8e5585b89..5778fb706 100644
--- a/src/BlockEntities/MobSpawnerEntity.cpp
+++ b/src/BlockEntities/MobSpawnerEntity.cpp
@@ -92,8 +92,10 @@ void cMobSpawnerEntity::UpdateActiveState(void)
bool cMobSpawnerEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
- // Update the active flag every 5 seconds
- if ((m_World->GetWorldAge() % 100) == 0)
+ using namespace std::chrono_literals;
+
+ // Update the active flag every 5 seconds:
+ if ((m_World->GetWorldTickAge() % 5s) == 0s)
{
UpdateActiveState();
}