Skip to content

Commit

Permalink
fix uninstalled addons showing up in lib when locked
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaGW2 committed Mar 3, 2024
1 parent d8d94b3 commit 050b4d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/GUI/Widgets/Addons/AddonItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ namespace GUI
if (aAddon == nullptr ||
aAddon->Definitions == nullptr ||
aAddon->State == EAddonState::NotLoadedDuplicate ||
aAddon->State == EAddonState::NotLoadedIncompatible)
aAddon->State == EAddonState::NotLoadedIncompatible ||
aAddon->WillBeUninstalled)
{
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/Loader/Addon.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct Addon
AddonDefinition* Definitions;
bool ShouldDisableNextLaunch;
bool IsPausingUpdates;
bool WillBeUninstalled;
};

#endif
2 changes: 1 addition & 1 deletion src/Loader/Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ namespace Loader
try
{
std::filesystem::rename(aPath, aPath.string() + extUninstall);
Addons.erase(aPath); // remove from addons list anyway
it->second->WillBeUninstalled = true;
LogWarning(CH_LOADER, "Addon is stilled loaded, it will be uninstalled the next time the game is restarted: %s", aPath.string().c_str());
}
catch (std::filesystem::filesystem_error fErr)
Expand Down

0 comments on commit 050b4d0

Please sign in to comment.