Skip to content

Commit

Permalink
blacklist: add DisableNightVisionFlash
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Jul 23, 2024
1 parent 7dd0c7b commit f0359b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 12 additions & 0 deletions source/SplinterCellBlacklist.FusionMod/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<uint8_t>(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";
Expand Down

0 comments on commit f0359b8

Please sign in to comment.