PlayerScaleDamage and PlayerTraceAttack broken?

I run a Stronghold server where ScalePlayerDamage and PlayerTraceAttack are vital to the gameplay, it seems like the recent source engine update broke them.

Anyone else having these issues or know what’s going on better than I do?

I can confirm that these hooks are broken with the last GMod update.

Our server is suffering too.

It’s ScalePlayerDamage not PlayerScaleDamage, just saying.

Ya, anyway, temporary hackish fix until Garry releases a proper update.


function GM:EntityTakeDamage( ent, inflictor, attacker, amount, dmginfo )
	if ( ent:IsPlayer() ) then
		hitgroup = HITGROUP_GENERIC;
		if ( IsValid(attacker) ) then
			hitgroup = attacker:GetEyeTrace().HitGroup;
		end
		hook.Call("ScalePlayerDamage", self, ent, hitgroup, dmginfo)
	end
end

The hitgroup will likely be off unless you set it to use a method you do for spread on your weapons.

you should use hook.Call(“ScalePlayerDamage”, self, ent, hitgroup, dmginfo) instead, to maintain compatibility.

Ya, I don’t have to worry about that with our code base. I went ahead and edited the temporary patch to include your suggestion.

This really stinks. I want my server to work again. :confused:

Well, someone needs to catch Garry’s attention so he knows its broken.

I’m guessing this is why weapon damage in TTT is broken?
As since last update they are all doing 50% damage on chest shot & 150% damage on headshot.

Line 4 should be


if ( IsValid(attacker) and attacker:IsPlayer() )then

But other than that it’s perfect, thanks a lot for the temporary fix. :smile:

Tommynator posted a fix for this on the TTT forums, located here.