[IW4MVM] Disable the mod when it's not needed

This commit is contained in:
momo5502 2017-07-05 21:37:54 +02:00
parent ff55efb4fd
commit d9ad474905

View File

@ -5,6 +5,8 @@ namespace Components
{
IW4MVM::IW4MVM()
{
if (Dedicated::IsEnabled() || ZoneBuilder::IsEnabled() || Monitor::IsEnabled() || Loader::IsPerformingUnitTests()) return;
DWORD oldProtect;
std::uint8_t* module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(nullptr));
VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READWRITE, &oldProtect);