hmmm, is this what was intended ?


(SCDS_reyalP) #21

The headshot damage ignores the previous reduction. So unless you re-write some other things, getting rid of the one in G_Damage will make only body shots reduce damage.


(jet Pilot) #22

You sure? Assume Bullet_Fire_Extended() is called with damage_falloff = true. If so, damage is reduced by the falloff algorithm. In the arguments for G_Damage(), damage is passed directly, and the conditional expression
(distance_falloff ? DAMAGE_DISTANCEFALLOFF : 0 ) sets G_Damage()'s dflags to DAMAGE_DISTANCEFALLOFF, which triggers the second falloff damage reduction in the headshot section. Correct me if I’m wrong, (I’m a bit rusty on my bit operands) but I really want to either get my head around the logic of this code section, or be positive that there is no logic here.


(SCDS_reyalP) #23

jet pilot: look at how headshot damage gets sets. It turns out for all the weapons that do have falloff, it gets set to 50, completely ignoring the previous falloff calc.


	if ( headShot ) {
		if( take * 2 < 50 ) // head shots, all weapons, do minimum 50 points damage
			take = 50;
		else
			take *= 2; // sniper rifles can do full-kill (and knock into limbo)

Making assumptions about ET code is always a bad idea :moo:


(Jaquboss) #24

Well , This really DOESNT MEAN that falloff is ignored for headshot
this is just forcing to do weapons at least 50 damage…
Well falloff source there have it sense… However this really doesnt mean that headshot code ignores falloff
But well everyone can do it how he one…
Also it is possible to just double damage and dont care about minium…
Just mod it how you want to have it…


(SCDS_reyalP) #25

In the current ET code, it means that removing the falloff calc from G_Damage would cause there to be no falloff for headshots, because take*2 is always < 50, for weapons that have distance falloff. Of course, you could re-arrange the code to avoid that. You can re-write the code to do almost anything you want :moo:

You should also realize that headshots fall off a different amount than other damage. Body damage falls off to 0.5, while headshots fall off to 0.2