LevelManager::generateLevel(): avoid multiple return points

this could cause unexpected results if additional code is added after background generation in the future.
This commit is contained in:
Dylan K. Taylor 2019-04-26 18:05:34 +01:00
parent 7c7f42eba6
commit 854c3a816c

View File

@ -292,10 +292,7 @@ class LevelManager{
(new LevelLoadEvent($level))->call();
if(!$backgroundGeneration){
return true;
}
if($backgroundGeneration){
$this->server->getLogger()->notice($this->server->getLanguage()->translateString("pocketmine.level.backgroundGeneration", [$name]));
$spawnLocation = $level->getSpawnLocation();
@ -320,6 +317,7 @@ class LevelManager{
Level::getXZ($index, $chunkX, $chunkZ);
$level->populateChunk($chunkX, $chunkZ, true);
}
}
return true;
}