ief015 / hitnumbers

A Garry's Mod addon which adds damage indicators whenever you damage something.
14 stars 4 forks source link

Fixed Bug not showing Damage while Dying #3

Closed ZenBre4ker closed 3 years ago

ZenBre4ker commented 3 years ago

By adding a hook to entitytakedamage again, we save the health amount before taking damage and can therefore address if something is already dead like a ragdoll. Therefore we gain the same inner workings as before we changed to the new PostEntityTakeDamage Hook and still enjoy the new features.

Solving #2 with that and also making some minor tweaks that where shown by the Glua linter, like using not and ~ instead of !. Tested this and it works fine even when you enable masks for world and other stuff.

ief015 commented 3 years ago

After trying a few different things to fix this issue, ended up with a solution somewhat similar to this one. https://github.com/ief015/hitnumbers/commit/fc87e48356be3b5ecb113e00fda82886f6ebc3fd

I'm not a huge fan of this workaround, but it appears to work reliably. We can leave it at that for now until we can find a more graceful solution.