actually update m_applied in Patch

This commit is contained in:
ConfiG 2023-09-07 21:32:28 +03:00
parent e399f21882
commit e557a551d8
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B

View file

@ -4,11 +4,17 @@
using namespace geode::prelude;
bool Patch::apply() {
return bool(tulip::hook::writeMemory(m_address, m_patch.data(), m_patch.size()));
bool res = bool(tulip::hook::writeMemory(m_address, m_patch.data(), m_patch.size()));
if (res)
m_applied = true;
return res;
}
bool Patch::restore() {
return bool(tulip::hook::writeMemory(m_address, m_original.data(), m_original.size()));
bool res = bool(tulip::hook::writeMemory(m_address, m_original.data(), m_original.size()));
if (res)
m_applied = false;
return res;
}
Patch::Patch() : m_owner(nullptr), m_address(nullptr), m_applied(false), m_autoEnable(true) {}