ResourcePacks: Fix various bugs

This commit is contained in:
spycrab
2019-02-07 23:02:44 +01:00
parent 2987e8313a
commit f86b34ceb9
4 changed files with 30 additions and 15 deletions

View File

@ -265,8 +265,9 @@ bool ResourcePack::Uninstall(const std::string& path)
// Check if a higher priority pack already provides a given texture, don't delete it
for (const auto& pack : GetHigherPriorityPacks(*this))
{
if (std::find(pack->GetTextures().begin(), pack->GetTextures().end(), texture) !=
pack->GetTextures().end())
if (::ResourcePack::IsInstalled(*pack) &&
std::find(pack->GetTextures().begin(), pack->GetTextures().end(), texture) !=
pack->GetTextures().end())
{
provided_by_other_pack = true;
break;
@ -279,8 +280,9 @@ bool ResourcePack::Uninstall(const std::string& path)
// Check if a lower priority pack provides a given texture - if so, install it.
for (auto& pack : lower)
{
if (std::find(pack->GetTextures().rbegin(), pack->GetTextures().rend(), texture) !=
pack->GetTextures().rend())
if (::ResourcePack::IsInstalled(*pack) &&
std::find(pack->GetTextures().rbegin(), pack->GetTextures().rend(), texture) !=
pack->GetTextures().rend())
{
pack->Install(path);