View Single Post
Plugin Info:     Modification:          Category:          Approver:   ConnorMcLeod (74)
Simo123
Junior Member
Join Date: Feb 2009
Old 02-24-2012 , 13:27   HP damage sound bug fix
Reply With Quote #1

Description
This plugin fixes a bug when you fall/jump from a low height to the ground, where it will not apply/reduce the damage but it will still play the damage sound. This fix blocks/ignores the damage sound when you have fallen/jumped from that low height to the ground.

1.What actually happens is that the collision model is too late being with the real character/model itself (~4 units away).
2.The hp number conversion rounding is wrong in the hl engine which do e.g. round a number of 0.9 to 0 instead of 1.0 because of a wrong float to int conversion, so when the hp gets less than 1 damage it rounds it to 0 damage which will just play the sound and ignore the hp reduction.


Modules
-amxmodx
-hamsandwich

Credits
Arkshine - Explaination of how the bug occurs (see #13 post).
protoN - Told me that health isn't a float, about the collision model and found a good place to test the bug on (video below).
Bla^ - Told me the rounding bug.


Other info
From beginning I thought that health was a float and that you could jump 10 times and it then would reduce the hp, but that wasn't true, it was actually a bug as explained above.

I made a fast video where the bug is shown.
http://youtu.be/oA5Y24WrkNY

Tested with amxmodx 1.8.1 in Counter-Strike 1.6.
Attached Files
File Type: sma Get Plugin or Get Source (dmg_sound_bug_fix.sma - 2652 views - 395 Bytes)

Last edited by Simo123; 08-16-2015 at 13:37. Reason: Updated description.
Simo123 is offline