mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-10 11:53:14 +08:00
fix(byte_patches): fix crash on exit (#160)
This commit is contained in:
@@ -4,7 +4,7 @@ namespace YimMenu
|
||||
{
|
||||
BytePatches::Patch::~Patch()
|
||||
{
|
||||
Restore();
|
||||
|
||||
}
|
||||
|
||||
void BytePatches::Patch::Apply()
|
||||
@@ -38,6 +38,8 @@ namespace YimMenu
|
||||
|
||||
void BytePatches::Remove(std::shared_ptr<Patch>& patch)
|
||||
{
|
||||
patch->Restore();
|
||||
|
||||
if (const auto it = std::find(m_Patches.begin(), m_Patches.end(), patch.get()); it != m_Patches.end())
|
||||
{
|
||||
m_Patches.erase(it);
|
||||
@@ -47,6 +49,11 @@ namespace YimMenu
|
||||
|
||||
void BytePatches::RestoreAll()
|
||||
{
|
||||
for (auto& patch : m_Patches)
|
||||
{
|
||||
patch->Restore();
|
||||
}
|
||||
|
||||
m_Patches.clear();
|
||||
}
|
||||
}
|
||||
@@ -167,9 +167,8 @@ namespace YimMenu::Submenus
|
||||
g_SelectedPlayer = nullptr;
|
||||
g_SelectedRid = 0;
|
||||
}
|
||||
|
||||
ImGui::EndChild();
|
||||
}
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
static void RenderSavedPlayers()
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace YimMenu::Submenus
|
||||
}
|
||||
}));
|
||||
|
||||
generalGroup->AddItem(std::make_shared<CommandItem>("playallmissionssolo"_J));
|
||||
generalGroup->AddItem(std::make_shared<BoolCommandItem>("playallmissionssolo"_J));
|
||||
|
||||
cayoPericoGroup->AddItem(std::make_shared<CommandItem>("skipcayosetup"_J));
|
||||
cayoPericoGroup->AddItem(std::make_shared<CommandItem>("skipcayocooldown"_J));
|
||||
|
||||
Reference in New Issue
Block a user