HP damage sound bug fix
1 Attachment(s)
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. 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). 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. |
Re: HP damage sound bug fix
I hated that bug and the code looks pretty simple.
Good job. |
Re: HP damage sound bug fix
Good job.
That's so easy but nobody has thought to this solution. :mrgreen: |
Re: HP damage sound bug fix
Nice bugfix, though only one problem.
This damage can come also from a gun at a big distance so you need to check the damage type in order to be 100% sure that the damage is because of a fall. The only problem that I see here is the situation where the damage comes from something else and can be multiplied. For example if someone shoots you with a glock pistol at a big distance and does 1 damage to you and hits your head the damage that you will receive will be 4. So you need to watch out for the hitgroup damage multiplication constants. Check this out: PHP Code:
|
Re: HP damage sound bug fix
@echo_cs: What is the logic behind that code?
|
Re: HP damage sound bug fix
Quote:
It's a bugfix plugin not a gravity feature plugin. |
Re: HP damage sound bug fix
@ot_207, are you sure hitgroups are needed on fall damage? Wouldn't checking DMG_FALL be an easier solution?
|
Re: HP damage sound bug fix
Oook Xpaw
I Have A reply The amxx is upproved for our life ? No It's Unapproved, It's a games A bad Games The players will be addicted and you olso Go Out of your home And Play the real Games And save yourself from the prison |
Re: HP damage sound bug fix
Quote:
You always block < 1.0 damage even from fall and bullets that basically do not damage. Also it depends if there are plugins that modify that hitgroup intentionally and it would be a good idea to check IMO. If you check with DMG_FALL you basically limit everything to fall. The only problem is if a plugin alters the private data you basically stop damage that can be dealt in some situations. |
Re: HP damage sound bug fix
By By alliedmods I will Return One day
My Real age is 13 And I learned Pawn & C++ And Im Arabic And I have stady English 3 hear only |
All times are GMT -4. The time now is 19:03. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.