summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-04-05 13:47:16 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-04-05 13:47:16 +0200
commita6b0c74f79dc6654b67b20c5c77965dccc044412 (patch)
tree555e9d4c2a7c337df931bea567f47d0aef0c6fd8 /src/Chunk.cpp
parentMerge pull request #3121 from LogicParrot/loops (diff)
parentImproved player freeze code (diff)
downloadcuberite-a6b0c74f79dc6654b67b20c5c77965dccc044412.tar
cuberite-a6b0c74f79dc6654b67b20c5c77965dccc044412.tar.gz
cuberite-a6b0c74f79dc6654b67b20c5c77965dccc044412.tar.bz2
cuberite-a6b0c74f79dc6654b67b20c5c77965dccc044412.tar.lz
cuberite-a6b0c74f79dc6654b67b20c5c77965dccc044412.tar.xz
cuberite-a6b0c74f79dc6654b67b20c5c77965dccc044412.tar.zst
cuberite-a6b0c74f79dc6654b67b20c5c77965dccc044412.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index c1baae9b2..bc0de0516 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -604,7 +604,19 @@ void cChunk::SpawnMobs(cMobSpawner & a_MobSpawner)
void cChunk::Tick(std::chrono::milliseconds a_Dt)
{
- m_IsInTick = true;
+ // If we are not valid, tick players and bailout
+ if (!IsValid())
+ {
+ for (auto Entity : m_Entities)
+ {
+ if (Entity->IsPlayer())
+ {
+ Entity->Tick(a_Dt, *this);
+ }
+ }
+ return;
+ }
+
BroadcastPendingBlockChanges();
CheckBlocks();
@@ -668,7 +680,6 @@ void cChunk::Tick(std::chrono::milliseconds a_Dt)
} // for itr - m_Entitites[]
ApplyWeatherToTop();
- m_IsInTick = false;
}