Add AllowMultiInstance.

This commit is contained in:
Ray Koopa 2020-07-20 20:17:20 +02:00
parent 2b94e09e39
commit 518207b7e6

View File

@ -7,6 +7,7 @@
// ---- Configuration ----
BOOL cfgAllowMultiInstance;
BOOL cfgEnableAllControls;
BOOL cfgUnlockCamera;
BOOL cfgUnlockCursor;
@ -16,11 +17,13 @@ void configure()
wk::Config config("wkUnlimiter.ini");
// Load INI settings.
config.get("Common", "AllowMultiInstance", cfgAllowMultiInstance, TRUE);
config.get("Frontend", "EnableAllControls", cfgEnableAllControls, TRUE);
config.get("Game", "UnlockCamera", cfgUnlockCamera, TRUE);
config.get("Game", "UnlockCursor", cfgUnlockCursor, TRUE);
// Ensure INI file has been created with default setting.
config.set("Common", "AllowMultiInstance", cfgAllowMultiInstance);
config.set("Frontend", "EnableAllControls", cfgEnableAllControls);
config.set("Game", "UnlockCamera", cfgUnlockCamera);
config.set("Game", "UnlockCursor", cfgUnlockCursor);
@ -30,6 +33,11 @@ void configure()
void patch(wk::Exe& exe, int gameVersion)
{
if (cfgAllowMultiInstance)
{
wk::Patch patch(exe.Offset(0x000E7AD1), 1);
patch.write((char)0xEB); // Requires WormKitDS as game executable loads modules after this patched out check.
}
if (cfgEnableAllControls)
{
wk::Patch patch(exe.Offset(0x001C5D26), 4);