diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-04-05 10:45:09 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-04-05 13:20:50 +0200 |
commit | a431b45641d119a91a74cd88768389eebeb54a68 (patch) | |
tree | 555e9d4c2a7c337df931bea567f47d0aef0c6fd8 /src/Chunk.cpp | |
parent | Merge pull request #3121 from LogicParrot/loops (diff) | |
download | cuberite-a431b45641d119a91a74cd88768389eebeb54a68.tar cuberite-a431b45641d119a91a74cd88768389eebeb54a68.tar.gz cuberite-a431b45641d119a91a74cd88768389eebeb54a68.tar.bz2 cuberite-a431b45641d119a91a74cd88768389eebeb54a68.tar.lz cuberite-a431b45641d119a91a74cd88768389eebeb54a68.tar.xz cuberite-a431b45641d119a91a74cd88768389eebeb54a68.tar.zst cuberite-a431b45641d119a91a74cd88768389eebeb54a68.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 15 |
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; } |