diff --git a/Minecraft.Client/Chunk.cpp b/Minecraft.Client/Chunk.cpp index d039227bf..4da8b2e3f 100644 --- a/Minecraft.Client/Chunk.cpp +++ b/Minecraft.Client/Chunk.cpp @@ -103,7 +103,7 @@ void Chunk::setPos(int x, int y, int z) // 4J - changed to just set the value rather than make a new one, if we've already created storage if( bb == NULL ) { - bb = AABB::newPermanent(-g, -g, -g, XZSIZE+g, SIZE+g, XZSIZE+g); + bb = std::unique_ptr(AABB::newPermanent(-g, -g, -g, XZSIZE+g, SIZE+g, XZSIZE+g)); } else { @@ -171,7 +171,7 @@ void Chunk::makeCopyForRebuild(Chunk *source) this->xm = source->xm; this->ym = source->ym; this->zm = source->zm; - this->bb = source->bb; + this->bb = move(source->bb); this->clipChunk = NULL; this->id = source->id; this->globalRenderableTileEntities = source->globalRenderableTileEntities; @@ -998,7 +998,7 @@ int Chunk::getList(int layer) void Chunk::cull(Culler *culler) { - clipChunk->visible = culler->isVisible(bb); + clipChunk->visible = culler->isVisible(bb.get()); } void Chunk::renderBB() @@ -1029,7 +1029,7 @@ void Chunk::clearDirty() Chunk::~Chunk() { - delete bb; + // delete bb; } bool Chunk::emptyFlagSet(int layer) diff --git a/Minecraft.Client/Chunk.h b/Minecraft.Client/Chunk.h index f7947156f..543e79971 100644 --- a/Minecraft.Client/Chunk.h +++ b/Minecraft.Client/Chunk.h @@ -47,7 +47,7 @@ public: int xRenderOffs, yRenderOffs, zRenderOffs; int xm, ym, zm; - AABB *bb; + unique_ptr bb; ClipChunk *clipChunk; int id;