Fall Damage
Well first lents talk about fall damage. In most of the mod source code i have
seen ID left a flag in to remove fall damage.
It's dmflags 8
Next lents talk about self damage. That is damage you take from blowback many rocket,bfg and most other missel weapons.
If you open up the quake 3 source code and look in g_combat.c and look for a line like below in G_Damage.
// always give half damage if hurting self
// calculated after knockback, so rocket jumping works
if ( targ == attacker) {
damage *= 0.5;
}
if ( damage < 1 ) {
damage = 1;
}
Now just after that add your now if targ == attacker statmant. Like so.
// always give half damage if hurting self
// calculated after knockback, so rocket jumping works
if ( targ == attacker) {
damage *= 0.5;
}
if ( damage < 1 ) {
damage = 1;
}
if ( targ == attacker && some_cvar.integer) {
damage *= 0;
}
What is going on here is the game runs down the list of if's and if every thing checks out gives damage. Now lents talk about Map damage aka lava/slime contents and drowning.
For now lents just call it P_WorldEffects damage removel.
P_WorldEffects In g_atcive.c handes this
damage,and how it effects the player.
But to remove it we need to when the damage effects the player not how.
If you search will is P_WorldEffects only come up in 3 places. One
of these is the one were looking for.
But which one. 2 of the refer to P_WorldEffects it's self so the last
one must be it.
So we strole of happy butts down to ware it says this.
// burn from lava, etc P_WorldEffects (ent); // apply all the damage taken this frame P_DamageFeedback (ent);Now if you look just below P_WorldEffects it says P_DamageFeedback with the note //apply all the damage taken this frame.
// burn from lava, etc
// P_WorldEffects (ent);
if( some_cvar.integer ) P_WorldEffects (ent);
// apply all the damage taken this frame
P_DamageFeedback (ent);
Well hope that help someone anyway enjoy --powerr