From 5ca3a7c2e76bc91356aaa1c6bc3d12bb2a3c6e9c Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 8 Mar 2021 16:39:43 +0000 Subject: shared_ptr -> unique_ptr in generators --- src/Generating/PrefabStructure.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/Generating/PrefabStructure.cpp') diff --git a/src/Generating/PrefabStructure.cpp b/src/Generating/PrefabStructure.cpp index 127cd0018..9814610b4 100644 --- a/src/Generating/PrefabStructure.cpp +++ b/src/Generating/PrefabStructure.cpp @@ -15,11 +15,11 @@ cPrefabStructure::cPrefabStructure( int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, cPlacedPieces && a_Pieces, - cTerrainHeightGenPtr a_HeightGen + cTerrainHeightGen & a_HeightGen ): Super(a_GridX, a_GridZ, a_OriginX, a_OriginZ), m_Pieces(std::move(a_Pieces)), - m_HeightGen(std::move(a_HeightGen)) + m_HeightGen(a_HeightGen) { } @@ -55,11 +55,7 @@ void cPrefabStructure::PlacePieceOnGround(cPlacedPiece & a_Piece) int BlockY; cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ); cChunkDef::HeightMap HeightMap; - m_HeightGen->GenHeightMap({ChunkX, ChunkZ}, HeightMap); + m_HeightGen.GenHeightMap({ChunkX, ChunkZ}, HeightMap); int TerrainHeight = cChunkDef::GetHeight(HeightMap, BlockX, BlockZ); a_Piece.MoveToGroundBy(TerrainHeight - FirstConnector.m_Pos.y + 1); } - - - - -- cgit v1.2.3