summaryrefslogtreecommitdiffstats
path: root/src/Generating/FinishGen.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2017-08-18 12:17:56 +0200
committerGitHub <noreply@github.com>2017-08-18 12:17:56 +0200
commit72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82 (patch)
treec1c1a040332d4ba1f784be25c67c9800e85015eb /src/Generating/FinishGen.cpp
parentSitting cats block enderchests from opening (#3906) (diff)
parentChanged entity ownership model to use smart pointers (diff)
downloadcuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.gz
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.bz2
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.lz
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.xz
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.zst
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.zip
Diffstat (limited to 'src/Generating/FinishGen.cpp')
-rw-r--r--src/Generating/FinishGen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index d1201797c..fe5ce82be 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -1489,11 +1489,11 @@ bool cFinishGenPassiveMobs::TrySpawnAnimals(cChunkDesc & a_ChunkDesc, int a_RelX
double AnimalY = a_RelY;
double AnimalZ = static_cast<double>(a_ChunkDesc.GetChunkZ() * cChunkDef::Width + a_RelZ + 0.5);
- cMonster * NewMob = cMonster::NewMonsterFromType(AnimalToSpawn);
+ auto NewMob = cMonster::NewMonsterFromType(AnimalToSpawn);
NewMob->SetHealth(NewMob->GetMaxHealth());
NewMob->SetPosition(AnimalX, AnimalY, AnimalZ);
- a_ChunkDesc.GetEntities().push_back(NewMob);
LOGD("Spawning %s #%i at {%.02f, %.02f, %.02f}", NewMob->GetClass(), NewMob->GetUniqueID(), AnimalX, AnimalY, AnimalZ);
+ a_ChunkDesc.GetEntities().emplace_back(std::move(NewMob));
return true;
}