YaLTeR / OpenAG

An open-source reimplementation of Adrenaline Gamer's client library.
https://j.mp/OpenAG
Other
134 stars 39 forks source link

Add fix to ghost shots from HLSDK 25th anniversary #188

Open rtxa opened 2 months ago

rtxa commented 2 months ago

According to latest HLSDK 25th anniversary, there was a client issue with ghost shots

        // JoshA: Changed from PM_STUDIO_BOX to PM_NORMAL in prediction code as otherwise if you hit an NPC or player's
        // bounding box but not one of their hitboxes, the shot won't hit on the server but it will
        // play a hit sound on the client and not make a decal (as if it hit the NPC/player).
        // We should mirror the way the server does the test here as close as possible.
        //
        // I initially thought I was just fixing some stupid Half-Life bug but no,
        // this is *the* root cause of all the ghost shot bad prediction bugs in Half-Life Deathmatch!
        //
        // Also... CStrike was always using PM_NORMAL for all of these so it didn't have the problem.
        gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_NORMAL, -1, &tr );

https://github.com/ValveSoftware/halflife/blob/master/cl_dll/ev_hldm.cpp#L424

pierow commented 1 month ago

I don't think this change alone fixes the issue. From my testing valve's fix doesn't work in multiplayer: https://github.com/ValveSoftware/halflife/issues/3772

I haven't tested again since the SDK has been updated, but I wouldn't expect that to fix it since it didn't work correctly in HL25 HLDM.

rtxa commented 1 month ago

Too bad it doesn't work, I would test it myself when I have some time. Maybe a little offtopic but have you tested if AG servers (using BulliT original code) has worst reg code than vanilla HLSDK? Before and after HLSDK25 update?