splewis/csgo-practice-mode

csutils-thrown nades crash when colliding with a player

Closed this issue · 3 comments

https://crash.limetech.org/ewvea2dapsur

Easiest way to reproduce is to start practicemode, place a bot (.bot), throw a flash at him, then use .throw to rethrow the nade.

crashes at a4ec4b:


.text:00A4EC36                         loc_A4EC36:                             ; CODE XREF: sub_A4E340+1D40↓j
.text:00A4EC36 F6 85 55 FF FF FF 08                    test    byte ptr [ebp+var_AC+1], 8
.text:00A4EC3D 0F 85 D0 02 00 00                       jnz     loc_A4EF13
.text:00A4EC43 8B 95 D0 FB FF FF                       mov     edx, dword ptr [ebp+var_430]
.text:00A4EC49 85 C0                                   test    eax, eax
.text:00A4EC4B F3 0F 10 8A FC 00 00 00                 movss   xmm1, dword ptr [edx+0FCh]
.text:00A4EC53 F3 0F 10 82 00 01 00 00                 movss   xmm0, dword ptr [edx+100h]
.text:00A4EC5B 74 47                                   jz      short loc_A4ECA4
.text:00A4EC5D F3 0F 10 95 DC FB FF FF                 movss   xmm2, [ebp+var_424]
.text:00A4EC65 0F 14 C9                                unpcklps xmm1, xmm1
.text:00A4EC68 0F 5A C9                                cvtps2pd xmm1, xmm1
.text:00A4EC6B F3 0F 10 1D 80 03 E4 00                 movss   xmm3, ds:dword_E40380
.text:00A4EC73 F3 0F 59 15 A0 12 EF 00                 mulss   xmm2, ds:dword_EF12A0
.text:00A4EC7B F3 0F 5C DA                             subss   xmm3, xmm2
.text:00A4EC7F 0F 28 D3                                movaps  xmm2, xmm3
.text:00A4EC82 0F 14 D2                                unpcklps xmm2, xmm2
.text:00A4EC85 0F 5A D2                                cvtps2pd xmm2, xmm2
.text:00A4EC88 F2 0F 59 15 70 0F F6 00                 mulsd   xmm2, ds:qword_F60F70
.text:00A4EC90 F2 0F 58 D1                             addsd   xmm2, xmm1
.text:00A4EC94 F2 0F 12 CA                             movddup xmm1, xmm2
.text:00A4EC98 66 0F 5A C9                             cvtpd2ps xmm1, xmm1
.text:00A4EC9C F3 0F 5D 0D 30 51 E4 00                 minss   xmm1, ds:dword_E45130
.text:00A4ECA4

for me crashes only when .throw-ing Smokes, Discombulators or Flashbangs.
HEs, Molotovs and Incendiaries seem to work fine.

I've attempted a fix in 9692747 for this with help from Deathknife.

I have some confidence this is fixed, so I'm going to close it for now.