mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix EnginePaths::setContentPacks
This commit is contained in:
parent
bced20be1f
commit
8a12ff5879
2 changed files with 5 additions and 2 deletions
|
|
@ -180,14 +180,16 @@ void EnginePaths::setCurrentWorldFolder(io::path folder) {
|
|||
|
||||
void EnginePaths::setContentPacks(std::vector<ContentPack>* contentPacks) {
|
||||
// Remove previous content entry-points
|
||||
for (const auto& pack : *this->contentPacks) {
|
||||
io::remove_device(pack.id);
|
||||
for (const auto& id : contentEntryPoints) {
|
||||
io::remove_device(id);
|
||||
}
|
||||
contentEntryPoints.clear();
|
||||
this->contentPacks = contentPacks;
|
||||
// Create content devices
|
||||
for (const auto& pack : *contentPacks) {
|
||||
auto parent = pack.folder.entryPoint();
|
||||
io::create_subdevice(pack.id, parent, pack.folder);
|
||||
contentEntryPoints.push_back(pack.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue