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/Entities/Player.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/Entities/Player.cpp') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 04a7f9be0..9f4fcb971 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -3156,8 +3156,6 @@ void cPlayer::SpawnOn(cClientHandle & a_Client) void cPlayer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { - m_ClientHandle->Tick(a_Dt); - if (m_ClientHandle->IsDestroyed()) { Destroy(); @@ -3182,13 +3180,6 @@ void cPlayer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) } } - if (!a_Chunk.IsValid()) - { - // Players are ticked even if the parent chunk is invalid. - // We've processed as much as we can, bail: - return; - } - ASSERT((GetParentChunk() != nullptr) && (GetParentChunk()->IsValid())); ASSERT(a_Chunk.IsValid()); -- cgit v1.2.3