From b902546863c4b17c6d8ff3f198713aba7a8bbadd Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 26 Feb 2012 16:15:09 +0000 Subject: New cChunkStay class for temporarily keeping chunks loaded even when then have no clients. For now unused, will be used by generator and lighting in the future. git-svn-id: http://mc-server.googlecode.com/svn/trunk@330 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/cChunk.h') diff --git a/source/cChunk.h b/source/cChunk.h index f0e47834d..3dc1c56fd 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -146,6 +146,9 @@ public: /// Returns true if there is a block entity at the coords specified bool HasBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ); + /// Sets or resets the internal flag that prevents chunk from being unloaded + void Stay(bool a_Stay = true); + void Tick(float a_Dt, MTRand & a_TickRandom); int GetPosX() { return m_PosX; } @@ -238,6 +241,9 @@ private: cClientHandleList m_UnloadQuery; cEntityList m_Entities; cBlockEntityList m_BlockEntities; + + /// Number of times the chunk has been requested to stay (by various cChunkStay objects); if zero, the chunk can be unloaded + int m_StayCount; bool m_bCalculateLighting; -- cgit v1.2.3