Skip to content

Conversation

@drunkwinter
Copy link
Contributor

@drunkwinter drunkwinter commented Dec 12, 2025

Changes:

  • Disables rain-related audio (e.g., surface impacts)
  • Disables wetness-related effects (e.g., reflections, footstep/vehicle interaction sounds, particles)

Todo:

snow_0.mp4
snow_1.mp4

@ThirteenAG
Copy link
Owner

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.

@drunkwinter
Copy link
Contributor Author

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.

@ThirteenAG
Copy link
Owner

Maybe @RecklessGlue540 can help with patterns.

@RecklessGlue540
Copy link
Contributor

RecklessGlue540 commented Dec 14, 2025

@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;
        }
    });
}

@drunkwinter
Copy link
Contributor Author

@RecklessGlue540 Thanks! Btw what is the best way to downgrade to a pre-CE version?

@RecklessGlue540
Copy link
Contributor

RecklessGlue540 commented Dec 14, 2025

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
But alternatively, ClonkAndre's archive from here is not too far from that: https://mega.nz/folder/Fn0Q3LhY#_0t1VZQFuQX22lMxRZNB1A

Make a copy of your IV folder without mods, download just the 1080.zip from there and paste its contents over the new folder.
Then download the latest build of FF + the legacy addon and paste both over as well and that should be it.
I tested this way myself just now.

@ThirteenAG ThirteenAG merged commit 6d406c3 into ThirteenAG:master Dec 14, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants