diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-02 16:37:21 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-02 16:55:00 +0100 |
commit | 07b7fd4ad3fef714399009efd5d4a903a561a6f2 (patch) | |
tree | 27253c8e468f068dd03d7bf8b434e4e78ca78144 /src/Chunk.h | |
parent | Merge pull request #2936 from mathias-github/master (diff) | |
download | cuberite-07b7fd4ad3fef714399009efd5d4a903a561a6f2.tar cuberite-07b7fd4ad3fef714399009efd5d4a903a561a6f2.tar.gz cuberite-07b7fd4ad3fef714399009efd5d4a903a561a6f2.tar.bz2 cuberite-07b7fd4ad3fef714399009efd5d4a903a561a6f2.tar.lz cuberite-07b7fd4ad3fef714399009efd5d4a903a561a6f2.tar.xz cuberite-07b7fd4ad3fef714399009efd5d4a903a561a6f2.tar.zst cuberite-07b7fd4ad3fef714399009efd5d4a903a561a6f2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.h | 5 |
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 |