Skip to content

Commit bba0f0c

Browse files
authored
Fix teargas crash (introduced by 3ce2cc1)
1 parent 265db7d commit bba0f0c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Client/multiplayer_sa/CMultiplayerSA.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4016,21 +4016,25 @@ static void __declspec(naked) HOOK_ComputeDamageResponse_StartChoking()
40164016

40174017
__asm
40184018
{
4019-
pushad
4020-
mov al, [esp+0x8C]
4019+
// Get weapon type before pushad to avoid stack offset corruption
4020+
mov al, [esp+0x8]
40214021
mov ucChokingWeaponType, al
4022+
4023+
pushad
40224024

40234025
mov ebx, [m_pChokingHandler]
40244026
test ebx, ebx
40254027
jz continueWithOriginalCode
40264028

4029+
// Push weapon type as parameter
4030+
movzx eax, ucChokingWeaponType
40274031
push eax
40284032
call ebx
40294033
add esp, 4
40304034
test al, al
4031-
popad
40324035

40334036
jnz continueWithOriginalCode
4037+
popad
40344038
jmp dwChokingDontchoke
40354039

40364040
continueWithOriginalCode:

0 commit comments

Comments
 (0)