Skip to content

Commit 4c65dd2

Browse files
authored
Fix for chainsaw clipping in Angela's room (#1179)
1 parent a6f4821 commit 4c65dd2

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

Patches/InputTweaks.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,12 @@ void InputTweaks::TweakGetDeviceState(LPDIRECTINPUTDEVICE8A ProxyInterface, DWOR
377377
return;
378378
}
379379

380+
// Clear the Ready Weapon button in the mirror room to avoid clipping issues
381+
if (GetRoomID() == R_APT_W_RM_109_2)
382+
{
383+
ControllerData->rgbButtons[KeyBinds.GetReadyWeaponButtonBind()] = KEY_CLEAR;
384+
}
385+
380386
// Clear the the pause button if a quicksave is in progress
381387
if (GameLoadFix && (GetIsWritingQuicksave() == 1 || GetTextAddr() == 1))
382388
ControllerData->rgbButtons[KeyBinds.GetPauseButtonBind()] = KEY_CLEAR;
@@ -446,6 +452,12 @@ void InputTweaks::TweakGetDeviceState(LPDIRECTINPUTDEVICE8A ProxyInterface, DWOR
446452
InfoCombo.State = false;
447453
}
448454

455+
// Clear the Ready Weapon keybind in the mirror room to avoid clipping issues
456+
if (GetRoomID() == R_APT_W_RM_109_2)
457+
{
458+
ClearKey(KeyBinds.GetKeyBind(KEY_READY_WEAPON));
459+
}
460+
449461
// Update Esc/Cancel input states
450462
EscInput.State = IsKeyPressed(KeyBinds.GetKeyBind(KEY_SKIP));
451463
EscInput.UpdateHolding();
@@ -851,6 +863,12 @@ void InputTweaks::ReadMouseButtons()
851863

852864
SetLMButton = (MouseState.rgbButtons[0] == KEY_SET);
853865
RMB.State = (MouseState.rgbButtons[1] == KEY_SET);
866+
867+
// Update right mouse button state, avoiding setting RMB for angela's mirror room
868+
if (GetRoomID() == R_APT_W_RM_109_2)
869+
{
870+
RMB.State = false;
871+
}
854872
}
855873

856874
float InputTweaks::GetMouseAnalogX()
@@ -1086,6 +1104,11 @@ BYTE KeyBindsHandler::GetPauseButtonBind()
10861104
return *(GetKeyBindsPointer() + 0xF0);
10871105
}
10881106

1107+
BYTE KeyBindsHandler::GetReadyWeaponButtonBind()
1108+
{
1109+
return *(GetKeyBindsPointer() + 0x128);
1110+
}
1111+
10891112
int CountCollectedMemos()
10901113
{
10911114
auto* psVar2 = GetMemoCountIndexPointer();

Patches/InputTweaks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class KeyBindsHandler
200200
public:
201201
BYTE GetKeyBind(int KeyIndex);
202202
BYTE GetPauseButtonBind();
203+
BYTE GetReadyWeaponButtonBind();
203204
};
204205

205206
// Hitboxes for pause and memo menu

Resources/BuildNo.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define BUILD_NUMBER 2244
1+
#define BUILD_NUMBER 2245

0 commit comments

Comments
 (0)