diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-03 19:19:11 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-03 19:19:11 +0100 |
commit | a5403c897658c0cb837c9167d74e7302a09659c2 (patch) | |
tree | 85013e81fad7154733fa52e58138b4c854a597ed /src/Chunk.h | |
parent | Merge pull request #2903 from marvinkopf/FixTabAutoComplete (diff) | |
parent | Fixed cChunk::m_Entities corruption upon world travel (diff) | |
download | cuberite-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 '')
-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 |