EntityFireBullets outputting 0 damage for all weapons

[lua]
hook.Add(“EntityFireBullets”,“FireBulletsTest”,function(ply,tbl)
print(tbl.Damage)
end)
[/lua]

Prints 0 in console. PrintTable-ing tbl gives something similar to
[lua]
AmmoType = Pistol
Attacker = [NULL Entity]
Damage = 0
Dir = 0.073956 -0.901247 -0.426948
Distance = 56755.83984375
Force = 1
HullSize = 0
Num = 1
Spread = 0.008730 0.008730 0.008730
Src = -314.517700 -1836.989746 -12192.468750
Tracer = 2
[/lua]

Why is this?

I think that function only returns the right damage if it’s a SWEP that fires the bullets (I just checked and I think that’s the case) - it’d be good if we could get a fix for this

[editline]18th March 2016[/editline]

Also, in the example above, you were doing



function(ply,tbl)


when the wiki says ‘ply’ can be any entity, not just a player… just wanted to point that out

I posted this in the Next Update thread (hopefully it’ll get fixed)

Yeah, I trimmed the code down for the thread. The original code checked if it was a player first
But thanks! :smiley: