From 5907df680861e19091018c33979ebabe53d7ed72 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 3 Nov 2022 00:52:37 +0000 Subject: Chunk: Optimise idle ticking * Instead of chunks ticking player objects, and the player object in turn ticking its client handle, let the world tick the client handles. This means we no longer need to maintain a special-case for chunks that shouldn't be ticking, but still need to process players. Partially reverts to the state before 054a89dd. --- src/Chunk.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 4bf4557d9..c9bd1dbcf 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -684,21 +684,6 @@ void cChunk::SpawnMobs(cMobSpawner & a_MobSpawner) void cChunk::Tick(std::chrono::milliseconds a_Dt) { - const auto ShouldTick = ShouldBeTicked(); - - // If we are not valid, tick players and bailout - if (!ShouldTick) - { - for (const auto & Entity : m_Entities) - { - if (Entity->IsPlayer()) - { - Entity->Tick(a_Dt, *this); - } - } - return; - } - TickBlocks(); // Tick all block entities in this chunk: -- cgit v1.2.3