refactor: remove calls to Vec3::newTemp when not returned

This commit is contained in:
orng
2026-03-26 04:19:04 -05:00
parent 9405f38f80
commit bee10e55a8
37 changed files with 6791 additions and 6831 deletions

View File

@@ -463,8 +463,8 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
schematicCoordToChunkCoord(destinationBox, te->x, te->z, rot, targetX,
targetZ);
Vec3* pos = Vec3::newTemp(targetX, targetY, targetZ);
if (chunkBox->containsIncludingLowerBound(pos)) {
Vec3 pos(targetX, targetY, targetZ);
if (chunkBox->containsIncludingLowerBound(&pos)) {
std::shared_ptr<TileEntity> teCopy = chunk->getTileEntity(
(int)targetX & 15, (int)targetY & 15, (int)targetZ & 15);
@@ -510,9 +510,8 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
// Add 0.01 as the AABB::contains function returns false if a value is
// <= the lower bound
Vec3* pos =
Vec3::newTemp(targetX + 0.01, targetY + 0.01, targetZ + 0.01);
if (!chunkBox->containsIncludingLowerBound(pos)) {
Vec3 pos(targetX + 0.01, targetY + 0.01, targetZ + 0.01);
if (!chunkBox->containsIncludingLowerBound(&pos)) {
++it;
continue;
}
@@ -800,8 +799,8 @@ void ConsoleSchematicFile::getBlocksAndData(LevelChunk* chunk, byteArray* data,
// if (xs * ys * zs == LevelChunk::BLOCKS_LENGTH)
//{
// byteArray blockData = byteArray(data->data + blocksP,
//Level::CHUNK_TILE_COUNT); chunk->getBlockData(blockData); blocksP +=
//blockData.length;
// Level::CHUNK_TILE_COUNT); chunk->getBlockData(blockData);
// blocksP += blockData.length;
// byteArray dataData = byteArray(data->data + dataP, 16384);
// chunk->getBlockLightData(dataData);