Skip to content

Commit

Permalink
conviction: blacklist cover improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Aug 15, 2024
1 parent 12c1e87 commit 986a7b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ m_Action=(Event=StackedDrop,Action=eActionType_PressB,Filter=epfCritical)
m_Action=(Name=GeoDropToLedgeState,StateCommand=SlideDrop,Action=eActionType_PressB,TargetType=TTYPE_Ledge )
m_Action=(Name=CoverNavStartState,StateCommand=InstantCheck,Action=eActionType_PressB, TargetType=TTYPE_None )
m_Action=(Name=CoverNavStartState,Action=eActionType_HoldB, TargetType=TTYPE_None )
m_Action=(Name=SlideOnGroundState,Action=eActionType_HoldB, TargetType=TTYPE_None )
m_Action=(Name=SlideOnGroundState,Action=eActionType_PressB, TargetType=TTYPE_None )
m_Action=(Name=RollState,Action=eActionType_HoldB,TargetType=TTYPE_None)
// [EchelonPlayer.SPNormalAction] -RightAnalog-
Expand All @@ -177,7 +177,7 @@ m_Action=(Name=WeaponUtilityState,StateCommand=DrawReload,Action=eActionType_Pre
// [EchelonPlayer.SPNormalAction] -LeftAnalog-
m_Action=(Event=ToggleCrouch,Action=eActionType_PressLeftAnalog,Filter=epfCritical)
m_Action=(Name=GeoDropToLedgeState,StateCommand=SlideDrop,Action=eActionType_PressB,TargetType=TTYPE_Ledge )
m_Action=(Name=SlideOnGroundState,StateCommand=Crouch,Action=eActionType_HoldB, TargetType=TTYPE_None )
m_Action=(Name=SlideOnGroundState,StateCommand=Crouch,Action=eActionType_PressLeftAnalog, TargetType=TTYPE_None )
// [EchelonPlayer.SPNormalAction] -LeftTrigger-
m_Action=(Event=TogglePrecisionModeOn,Action=eActionType_PressLeftTrigger,Filter=epfCritical, TargetType=TTYPE_None )
Expand Down Expand Up @@ -1488,7 +1488,7 @@ m_Action=(Name=WeaponUtilityState,StateCommand=DrawReload,Action=eActionType_Pre
// [EchelonPlayer.SPCosteNormalAction] -LeftAnalog-
m_Action=(Event=ToggleCrouch,Action=eActionType_PressLeftAnalog,Filter=epfCritical)
m_Action=(Name=SlideOnGroundState,StateCommand=Crouch,Action=eActionType_HoldB, TargetType=TTYPE_None )
m_Action=(Name=SlideOnGroundState,StateCommand=Crouch,Action=eActionType_PressLeftAnalog, TargetType=TTYPE_None )
// [EchelonPlayer.SPCosteNormalAction] -RightShoulder-
Expand All @@ -1498,7 +1498,7 @@ 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 )
m_Action=(Name=SlideOnGroundState,Action=eActionType_HoldB, TargetType=TTYPE_None )
m_Action=(Name=SlideOnGroundState,Action=eActionType_PressB, TargetType=TTYPE_None )
m_Action=(Name=RollState,Action=eActionType_HoldB,TargetType=TTYPE_None)
// [EchelonPlayer.SPCosteNormalAction] -Visual Interaction-
Expand Down
2 changes: 1 addition & 1 deletion external/hooking
Submodule hooking updated 1 files
+1 −0 Hooking.Patterns.h
37 changes: 5 additions & 32 deletions source/SplinterCellConviction.FusionMod/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,47 +735,20 @@ void Init()
{
if (regs.eax == DetectB2W || regs.eax == StopDetectB2W)
{
static bool toggleState = false; // Toggle state for entering/exiting cover
static bool buttonWasPressed = false; // Tracks if the button was previously pressed
auto bInCover = bCoverStateStarted;

// Check if the button is currently pressed
bool buttonIsPressed = (regs.eax == DetectB2W);

// Toggle the state only on the transition from not pressed to pressed
if (buttonIsPressed && !buttonWasPressed)
if (regs.eax == DetectB2W)
{
toggleState = !toggleState;

// Apply the toggle state to enter or exit cover
if (toggleState)
if (bInCover)
{
// Enter cover if not already in cover
if (!bInCover)
{
lastDetectTime = std::chrono::steady_clock::now();
*(uint32_t*)(regs.esi + 0xA44) |= 0x100;
}
*(uint32_t*)(regs.esi + 0xA44) &= ~0x100;
}
else
{
// Exit cover if currently in cover
if (bInCover)
{
*(uint32_t*)(regs.esi + 0xA44) &= ~0x100;
}
lastDetectTime = std::chrono::steady_clock::now();
*(uint32_t*)(regs.esi + 0xA44) |= 0x100;
}
}
else if (!buttonIsPressed)
{
// If the button is released, ensure the player does not get stuck in a seeking cover state
//if (!bCoverStateStarted)
// *(uint32_t*)(regs.esi + 0xA44) &= ~0x100;
}

// Update the buttonWasPressed state for the next frame
buttonWasPressed = buttonIsPressed;
//bCoverStateStarted = false;
}
else
*(uintptr_t*)(regs.esp - 4) = loc_56DBB3;
Expand Down

0 comments on commit 986a7b3

Please sign in to comment.