1
0

Improved player freeze code

This commit is contained in:
LogicParrot
2016-04-05 11:45:09 +03:00
parent 4b626e1376
commit a431b45641
8 changed files with 99 additions and 76 deletions

View File

@@ -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;
}