halflife icon indicating copy to clipboard operation
halflife copied to clipboard

[OP4] Glock secondary fire recoil

Open dagla opened this issue 13 years ago • 2 comments

In Opposing Force the glocks secondary fire has the same recoil as the primary fire, so its just shooting faster without a disadvantage of increased recoil as in the original game.

dagla avatar Mar 30 '13 14:03 dagla

actually this is only a problem of clientside prediction the spread values are probably not sent / used within the event API; in fact the spread is actually increased with the secondary fire just like in HLDM glock (check with cl_lw 0 where you will clearly see the bullets spreading, or test while shooting a standing bot / player)

ghost avatar Apr 09 '13 23:04 ghost

This happens because as stated above the spread values aren't sent: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/dlls/wpn_shared/hl_wpn_glock.cpp#L162

In Half-Life and the SDK vecDir.x and vecDir.y are passed along to the event as the float parameters. In Opposing Force 0 is passed for both.

The Opposing Force version of the Glock seems to be missing a few other updates. It's still using FireBullets instead of FireBulletsPlayer so the prediction related changes are probably missing.

More specifically it seems Opposing Force is using glock.cpp: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/dlls/glock.cpp

Whereas Half-Life and the SDK use hl_wpn_glock.cpp. glock.cpp is the old, partially updated version of the Glock. It has a few prediction related updated like event playback, but it was replaced by hl_wpn_glock.cpp which contains the complete, up-to-date version of the Glock with all updates applied.

Updating Opposing Force to use the correct file, and verifying that all bug fixes applied to glock.cpp are applied to hl_wpn_glock.cpp as well should fix this and any other Glock related bugs that may be caused by this.

SamVanheer avatar Feb 10 '21 19:02 SamVanheer