Quake Style - Quake 3 Tutorials
Newbie Tutorials - Modifying Knockback
This tutorial will make Rocket Jumpers fly to heaven!

Ok, another fairly simple tutorial from me today!

Open up g_combat.c, and go down to the function "void G_Damage".
Find these lines, and add the blue code:

	knockback = damage;
	if ( knockback > 200 ) {
		knockback = 200;
	}

/* (NOBODY): If it is some sort of explosion which does splash damage, multiply the knockback by two. Mucho rocket jumping! */
	if ( dflags & DAMAGE_RADIUS ) {
		knockback *= 2;
	}

	if ( targ->flags & FL_NO_KNOCKBACK ) {
		knockback = 0;
	}
	if ( dflags & DAMAGE_NO_KNOCKBACK ) {
		knockback = 0;
	}

You will now, after any explosion or anything which does splash damage, (ie, grenades, rockets, plasma, and bfg shots) be propelled twice as far as you normally do.

Have fun :)

-- Credits:
   Tutorial by (nobody)
   Return to QS Tutorials

-- Important:
   If you do use something from QuakeStyle in your mod, please give us credit.
   Our code is copyrighted, but we give permission to everyone to use it in any way they see fit, as long as we are recognized.