summaryrefslogtreecommitdiffstats
path: root/src/Chunk.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-03 19:19:11 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-03 19:19:11 +0100
commita5403c897658c0cb837c9167d74e7302a09659c2 (patch)
tree85013e81fad7154733fa52e58138b4c854a597ed /src/Chunk.h
parentMerge pull request #2903 from marvinkopf/FixTabAutoComplete (diff)
parentFixed cChunk::m_Entities corruption upon world travel (diff)
downloadcuberite-a5403c897658c0cb837c9167d74e7302a09659c2.tar
cuberite-a5403c897658c0cb837c9167d74e7302a09659c2.tar.gz
cuberite-a5403c897658c0cb837c9167d74e7302a09659c2.tar.bz2
cuberite-a5403c897658c0cb837c9167d74e7302a09659c2.tar.lz
cuberite-a5403c897658c0cb837c9167d74e7302a09659c2.tar.xz
cuberite-a5403c897658c0cb837c9167d74e7302a09659c2.tar.zst
cuberite-a5403c897658c0cb837c9167d74e7302a09659c2.zip
Diffstat (limited to 'src/Chunk.h')
-rw-r--r--src/Chunk.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Chunk.h b/src/Chunk.h
index d944af10a..41bc79746 100644
--- a/src/Chunk.h
+++ b/src/Chunk.h
@@ -260,6 +260,9 @@ public:
void AddEntity(cEntity * a_Entity);
void RemoveEntity(cEntity * a_Entity);
+ /** RemoveEntity is dangerous if the chunk is inside the tick() method because it invalidates the iterator.
+ This will safely remove an entity. */
+ void SafeRemoveEntity(cEntity * a_Entity);
bool HasEntity(UInt32 a_EntityID);
/** Calls the callback for each entity; returns true if all entities processed, false if the callback aborted by returning true */
@@ -502,7 +505,7 @@ private:
/** If the chunk fails to load, should it be queued in the generator or reset back to invalid? */
bool m_ShouldGenerateIfLoadFailed;
-
+ bool m_IsInTick; // True if the chunk is executing the tick() method.
bool m_IsLightValid; // True if the blocklight and skylight are calculated
bool m_IsDirty; // True if the chunk has changed since it was last saved
bool m_IsSaving; // True if the chunk is being saved