From f0359b8cbfd3fe37596f7f5bd902b879477f1c75 Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Wed, 24 Jul 2024 01:09:27 +0800 Subject: [PATCH] blacklist: add DisableNightVisionFlash --- .../scripts/SplinterCellBlacklist.FusionMod.ini | 5 +++-- source/SplinterCellBlacklist.FusionMod/dllmain.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/data/SplinterCellBlacklist.FusionMod/src/system/scripts/SplinterCellBlacklist.FusionMod.ini b/data/SplinterCellBlacklist.FusionMod/src/system/scripts/SplinterCellBlacklist.FusionMod.ini index 8a1febe6c..d55bbf160 100644 --- a/data/SplinterCellBlacklist.FusionMod/src/system/scripts/SplinterCellBlacklist.FusionMod.ini +++ b/data/SplinterCellBlacklist.FusionMod/src/system/scripts/SplinterCellBlacklist.FusionMod.ini @@ -7,6 +7,7 @@ UltraWideSupport = 1 // Damage overlay and fading will be FOVFactor = 1.0 // [0.5, 2.5] ScreenCullBias = 0.0 // 0.0 achieves the best draw distance, game default value is 1.0, but it makes distant objects disappear ShadowCullDist = 100.0 // 100.0 for increased draw distance of shadows, game default value is 90.0 +DisableNightVisionFlash = 1 // Disables the white flash when activating night vision [UNLOCKS] UnlockDLC = 1 // Unlocks all DLC content that is not possible to obtain after server shutdown @@ -31,8 +32,8 @@ DisableMissionFailOnDetection = 1 // If set to 1, the mission will not [COOP] // Briggs Missions ReinforcementsNumber = Default // Default | Random ReinforcementsEnemyMultiplier = 1 // Multiplies the number of reinforcements with the Default config -ReinforcementsEnemyRandomRangeMin = 1 // With the Random config, specifies the total number of -ReinforcementsEnemyRandomRangeMax = 10 // reinforcements between Min and Max. Setting this value too high can make the final mission impossible to complete +ReinforcementsEnemyRandomRangeMin = 10 // With the Random config, specifies the total number of +ReinforcementsEnemyRandomRangeMax = 20 // reinforcements between Min and Max. Setting this value too high can make the final mission impossible to complete DisableMissionFailOnDetection = 0 // If set to 1, the mission will not fail when the player is detected [CAMPAIGN] // Story Missions diff --git a/source/SplinterCellBlacklist.FusionMod/dllmain.cpp b/source/SplinterCellBlacklist.FusionMod/dllmain.cpp index d9222ebed..e3cdb679a 100644 --- a/source/SplinterCellBlacklist.FusionMod/dllmain.cpp +++ b/source/SplinterCellBlacklist.FusionMod/dllmain.cpp @@ -135,6 +135,7 @@ void Init() static auto fFOVFactor = std::clamp(iniReader.ReadFloat("MAIN", "FOVFactor", 1.0f), 0.5f, 2.5f); fScreenCullBias = std::clamp(iniReader.ReadFloat("MAIN", "ScreenCullBias", 0.0f), 0.0f, 1.0f); static float fShadowCullDist = std::clamp(iniReader.ReadFloat("MAIN", "ShadowCullDist", 100.0f), 90.0f, 120.0f); + auto bDisableNightVisionFlash = iniReader.ReadInteger("MAIN", "DisableNightVisionFlash", 1) != 0; sExtractionWaveConfigs = iniReader.ReadString("EXTRACTION", "ExtractionWaveConfigs", "Default"); nExtractionWaveEnemyMultiplier = std::clamp(iniReader.ReadInteger("EXTRACTION", "ExtractionWaveEnemyMultiplier", 1), 1, 9999); @@ -780,6 +781,17 @@ void Init() pattern = hook::pattern("74 18 8B 80 ? ? ? ? 85 C0 74 0E 8B 4E 3C 83 E1 01 51 8B C8 E8"); injector::WriteMemory(pattern.get_first(), 0xEB, true); //jz -> jmp } + + if (bDisableNightVisionFlash) + { + // FThermalSonarVisionComponent::SetActiveVisionMode + pattern = hook::pattern("D9 46 70 D9 9E"); + injector::MakeNOP(pattern.get_first(), 9, true); + static auto SetActiveVisionModeHook = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) + { + *(float*)(regs.esi + 0x8C) = -0.1f; + }); + } } std::string currentGogglesLight = "LightGreen";