Skip to content

Commit

Permalink
conviction: simplify cover code
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Aug 24, 2024
1 parent 91870ce commit ffa6f44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ m_Action=(GameMode=eGameMode_MPOnly, Name=MarkTargetState, StateCommand=ReleaseM
// [EchelonPlayer.SPNormalAction] -B-
m_Action=(Event=DetectB2W,Action=eActionType_PressB,Filter=epfCritical)
m_Action=(Event=DetectB2W,Action=eActionType_HoldB,Filter=epfCritical)
m_Action=(Event=StopDetectB2W,Action=eActionType_ReleaseB,Filter=epfCritical)
m_Action=(Event=StackedDrop,Action=eActionType_PressB,Filter=epfCritical)
m_Action=(Name=GeoDropToLedgeState,StateCommand=SlideDrop,Action=eActionType_PressB,TargetType=TTYPE_Ledge )
Expand Down Expand Up @@ -472,7 +471,6 @@ m_Action=(GameMode=eGameMode_SPOnly, Event=MAERealOff, Action=eActionType_Releas
// [EchelonPlayer.SPCrouchAction] -B-
m_Action=(Event=DetectB2W,Action=eActionType_PressB,Filter=epfCritical)
m_Action=(Event=DetectB2W,Action=eActionType_HoldB,Filter=epfCritical)
m_Action=(Event=StopDetectB2W,Action=eActionType_ReleaseB,Filter=epfCritical)
m_Action=(Name=CoverNavStartState,StateCommand=InstantCheck,Action=eActionType_PressB, TargetType=TTYPE_None )
m_Action=(Name=CoverNavStartState,Action=eActionType_HoldB, TargetType=TTYPE_None )
Expand Down Expand Up @@ -1494,7 +1492,6 @@ m_Action=(Name=SlideOnGroundState,StateCommand=Crouch,Action=eActionType_PressLe
// [EchelonPlayer.SPCosteNormalAction] -B-
m_Action=(Event=DetectB2W,Action=eActionType_PressB,Filter=epfCritical)
m_Action=(Event=DetectB2W,Action=eActionType_HoldB,Filter=epfCritical)
m_Action=(Event=StopDetectB2W,Action=eActionType_ReleaseB,Filter=epfCritical)
m_Action=(Name=CoverNavStartState,StateCommand=InstantCheck,Action=eActionType_PressB, TargetType=TTYPE_None )
m_Action=(Name=CoverNavStartState,Action=eActionType_HoldB, TargetType=TTYPE_None )
Expand Down Expand Up @@ -1604,7 +1601,6 @@ m_Action=(Name=ThrowGrenadeState,Action=eActionType_ReleaseX,TargetType=TTYPE_No
// [EchelonPlayer.SPCosteCrouchAction] -B-
m_Action=(Event=DetectB2W,Action=eActionType_PressB,Filter=epfCritical)
m_Action=(Event=DetectB2W,Action=eActionType_HoldB,Filter=epfCritical)
m_Action=(Event=StopDetectB2W,Action=eActionType_ReleaseB,Filter=epfCritical, TargetType=TTYPE_None )
m_Action=(Name=CoverNavStartState,StateCommand=InstantCheck,Action=eActionType_PressB, TargetType=TTYPE_None )
m_Action=(Name=CoverNavStartState,Action=eActionType_HoldB, TargetType=TTYPE_None )
Expand Down
21 changes: 3 additions & 18 deletions source/SplinterCellConviction.FusionMod/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,22 +740,13 @@ void Init()
{
if (bCoverStateStarted)
{
if (bReleased)
*(uint32_t*)(regs.esi + 0xA44) &= ~0x100;
*(uint32_t*)(regs.esi + 0xA44) &= ~0x100;
}
else
{
if (bReleased)
{
lastDetectTime = std::chrono::steady_clock::now();
*(uint32_t*)(regs.esi + 0xA44) |= 0x100;
}
lastDetectTime = std::chrono::steady_clock::now();
*(uint32_t*)(regs.esi + 0xA44) |= 0x100;
}
bReleased = false;
}
else
{
bReleased = true;
}
}
else
Expand All @@ -775,12 +766,6 @@ void Init()
bCoverStateStarted = false;
});

pattern = hook::pattern("55 8B EC 83 EC 50 53 56 8B F1 8B 46 5C");
static auto UCoverNavEndState2 = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs)
{
bCoverStateStarted = false;
});

pattern = hook::pattern("66 F7 86 ? ? ? ? ? ? 0F 84 ? ? ? ? 0F 57 C0");
static auto UCoverNavStartStateCheck = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs)
{
Expand Down

0 comments on commit ffa6f44

Please sign in to comment.