Skip to content

Commit

Permalink
conviction: add check for released cover button
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Aug 15, 2024
1 parent 986a7b3 commit fba8f98
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source/SplinterCellConviction.FusionMod/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ void Init()

// cover
static bool bCoverStateStarted = false;
static bool bReleased = false;
static auto loc_56DBB3 = (uintptr_t)hook::get_pattern("3B 05 ? ? ? ? 75 13 8B 8E ? ? ? ? 8B 01");
static auto lastDetectTime = std::chrono::steady_clock::now();

Expand All @@ -735,19 +736,26 @@ void Init()
{
if (regs.eax == DetectB2W || regs.eax == StopDetectB2W)
{
auto bInCover = bCoverStateStarted;

if (regs.eax == DetectB2W)
{
if (bInCover)
if (bCoverStateStarted)
{
*(uint32_t*)(regs.esi + 0xA44) &= ~0x100;
if (bReleased)
*(uint32_t*)(regs.esi + 0xA44) &= ~0x100;
}
else
{
lastDetectTime = std::chrono::steady_clock::now();
*(uint32_t*)(regs.esi + 0xA44) |= 0x100;
if (bReleased)
{
lastDetectTime = std::chrono::steady_clock::now();
*(uint32_t*)(regs.esi + 0xA44) |= 0x100;
}
}
bReleased = false;
}
else
{
bReleased = true;
}
}
else
Expand Down

0 comments on commit fba8f98

Please sign in to comment.