-
-
Notifications
You must be signed in to change notification settings - Fork 88
Disable certain effects when snowing #1168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I think it would be better to use mid hook instead of raw mem. If you're not sure how to implement that, I can do it later. |
I first wanted to use mid hooks, but then thought that was maybe a bit overkill. But sure I can change it in a moment. |
|
Maybe @RecklessGlue540 can help with patterns. |
|
@drunkwinter Here are the adapted hooks: // Disables rain-related audio (e.g. Surface impacts)
auto pattern = hook::pattern("F3 0F 10 05 ? ? ? ? F3 0F 11 04 24 E8 ? ? ? ? 51");
if (!pattern.empty())
{
static auto SetRainAudioHook = safetyhook::create_mid(pattern.get_first(8), [](SafetyHookContext& ctx)
{
if (enabled)
{
ctx.xmm0.f32[0] = 0.0f;
}
});
}
else
{
pattern = hook::pattern("D9 1C 24 E8 ? ? ? ? 51 D9 1C 24 E8 ? ? ? ? D8 44 24 08 83 C4 04 5E 59 C3 CC");
static auto SetRainAudioHook = safetyhook::create_mid(pattern.get_first(3), [](SafetyHookContext& ctx)
{
if (enabled)
{
*(float*)ctx.esp = 0.0f;
}
});
}
// Disables wetness-related effects (e.g. Reflections, footstep/vehicle interaction sounds, particles)
pattern = hook::pattern("C7 05 ? ? ? ? 00 00 80 3F F3 0F 10 25 ? ? ? ? F3 0F 10 04");
if (!pattern.empty())
{
pWetness = *reinterpret_cast<float**>(pattern.get_first(2));
static auto SetRainWetnessHook = safetyhook::create_mid(pattern.get_first(10), [](SafetyHookContext& ctx)
{
if (enabled)
{
*pWetness = 0.0f;
}
});
}
else
{
pattern = hook::pattern("F3 0F 11 05 ? ? ? ? EB 67");
pWetness = *reinterpret_cast<float**>(pattern.get_first(4));
injector::MakeNOP(pattern.get_first(0), 8, true);
static auto SetRainWetnessHook = safetyhook::create_mid(pattern.get_first(0), [](SafetyHookContext& ctx)
{
*pWetness = 1.0f;
if (enabled)
{
*pWetness = 0.0f;
}
});
} |
|
@RecklessGlue540 Thanks! Btw what is the best way to downgrade to a pre-CE version? |
I would recommend to get a hold of official files if possible and downgrade manually Make a copy of your IV folder without mods, download just the 1080.zip from there and paste its contents over the new folder. |
Changes:
Todo:
snow_0.mp4
snow_1.mp4