twhl-community / halflife-updated

Half-Life SDK updated to compile under VS2019 and 2022. Check README.md for more information.
Other
382 stars 146 forks source link

Fix breakable objects reflecting the Gauss Gun shot that breaks them #221

Open Toodles2You opened 1 year ago

Toodles2You commented 1 year ago

This is a very specific quirk that I discovered while testing other changes. The Gauss Gun will kill breakables, resulting in the pev->takedamage field being set to 0. The ReflectGauss member is called after this occurs, which then checks the pev->takedamage field, finds that the breakable doesn't take damage and reflects the shot.

https://github.com/SamVanheer/halflife-updated/blob/master/dlls/gauss.cpp#L400 https://github.com/SamVanheer/halflife-updated/blob/master/dlls/gauss.cpp#L407

The new override members should always ensure the intended behavior.