fix EnginePaths::setContentPacks
This commit is contained in:
parent
bced20be1f
commit
8a12ff5879
@ -180,14 +180,16 @@ void EnginePaths::setCurrentWorldFolder(io::path folder) {
|
|||||||
|
|
||||||
void EnginePaths::setContentPacks(std::vector<ContentPack>* contentPacks) {
|
void EnginePaths::setContentPacks(std::vector<ContentPack>* contentPacks) {
|
||||||
// Remove previous content entry-points
|
// Remove previous content entry-points
|
||||||
for (const auto& pack : *this->contentPacks) {
|
for (const auto& id : contentEntryPoints) {
|
||||||
io::remove_device(pack.id);
|
io::remove_device(id);
|
||||||
}
|
}
|
||||||
|
contentEntryPoints.clear();
|
||||||
this->contentPacks = contentPacks;
|
this->contentPacks = contentPacks;
|
||||||
// Create content devices
|
// Create content devices
|
||||||
for (const auto& pack : *contentPacks) {
|
for (const auto& pack : *contentPacks) {
|
||||||
auto parent = pack.folder.entryPoint();
|
auto parent = pack.folder.entryPoint();
|
||||||
io::create_subdevice(pack.id, parent, pack.folder);
|
io::create_subdevice(pack.id, parent, pack.folder);
|
||||||
|
contentEntryPoints.push_back(pack.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@ private:
|
|||||||
io::path currentWorldFolder;
|
io::path currentWorldFolder;
|
||||||
std::optional<std::filesystem::path> scriptFolder;
|
std::optional<std::filesystem::path> scriptFolder;
|
||||||
std::vector<ContentPack>* contentPacks = nullptr;
|
std::vector<ContentPack>* contentPacks = nullptr;
|
||||||
|
std::vector<std::string> contentEntryPoints;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PathsRoot {
|
struct PathsRoot {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user