Fix exceptions when exiting after opening world.

This commit is contained in:
Soggy_Pancake 2026-03-03 23:51:36 -07:00
parent b1b4435c01
commit 48a649abf1
2 changed files with 5 additions and 5 deletions

View file

@ -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 // 4J - changed to just set the value rather than make a new one, if we've already created storage
if( bb == NULL ) if( bb == NULL )
{ {
bb = AABB::newPermanent(-g, -g, -g, XZSIZE+g, SIZE+g, XZSIZE+g); bb = std::unique_ptr<AABB>(AABB::newPermanent(-g, -g, -g, XZSIZE+g, SIZE+g, XZSIZE+g));
} }
else else
{ {
@ -171,7 +171,7 @@ void Chunk::makeCopyForRebuild(Chunk *source)
this->xm = source->xm; this->xm = source->xm;
this->ym = source->ym; this->ym = source->ym;
this->zm = source->zm; this->zm = source->zm;
this->bb = source->bb; this->bb = move(source->bb);
this->clipChunk = NULL; this->clipChunk = NULL;
this->id = source->id; this->id = source->id;
this->globalRenderableTileEntities = source->globalRenderableTileEntities; this->globalRenderableTileEntities = source->globalRenderableTileEntities;
@ -998,7 +998,7 @@ int Chunk::getList(int layer)
void Chunk::cull(Culler *culler) void Chunk::cull(Culler *culler)
{ {
clipChunk->visible = culler->isVisible(bb); clipChunk->visible = culler->isVisible(bb.get());
} }
void Chunk::renderBB() void Chunk::renderBB()
@ -1029,7 +1029,7 @@ void Chunk::clearDirty()
Chunk::~Chunk() Chunk::~Chunk()
{ {
delete bb; // delete bb;
} }
bool Chunk::emptyFlagSet(int layer) bool Chunk::emptyFlagSet(int layer)

View file

@ -47,7 +47,7 @@ public:
int xRenderOffs, yRenderOffs, zRenderOffs; int xRenderOffs, yRenderOffs, zRenderOffs;
int xm, ym, zm; int xm, ym, zm;
AABB *bb; unique_ptr<AABB> bb;
ClipChunk *clipChunk; ClipChunk *clipChunk;
int id; int id;