Facepunch / garrysmod-issues

Garry's Mod issue tracker
142 stars 56 forks source link

Bullet callback gives wrong bone info for shotgun. #5042

Open Ramalayha opened 3 years ago

Ramalayha commented 3 years ago

When you shoot an npc with the shotgun you will often get the wrong PhysicsBone and HitBoxBone from the trace result in the bullet callback. Other guns work fine.

Code to reproduce

Video

robotboy655 commented 3 years ago

It's an issue with all hull traces (which is what shotgun uses for half its pellets). It can simply hit multiple hitboxes, although I am not even sure it tests hitboxes.

Ramalayha commented 3 years ago

Is there a reason for them to use hull traces?

Kefta commented 3 years ago

Because that's what Valve used for HL2.

Ramalayha commented 3 years ago

Would anything break from changing it? It just seems like a weird/unnecessary way to do it and besides making the bullet callback basically useless for hit detection I've noticed other issues such as ragdolls not reacting properly to where the npc was shot which I assume is caused by this as well.

robotboy655 commented 3 years ago

making the bullet callback basically useless

It's literally just this 1 weapon that does this, and it doesn't make the callback useless.

I have no plans on changing this behavior of the standard shotgun.

Ramalayha commented 3 years ago

Well yeah I meant useless in the context of getting reliable hit detection for this specific gun. It can be worked around ofcourse I just think having to make a hook just to fix this 1 gun instead of having consistent behaviour is a bit silly. But I can understand not wanting to change vanilla behaviour so I'll drop it.