All pastes #482676 Raw Edit

Stuff

public c v1 · immutable
·published 2007-05-11 11:14 UTC
rendered paste body
Index: src/game/g_combat.c===================================================================--- src/game/g_combat.c	(Revision 8374)+++ src/game/g_combat.c	(Arbeitskopie)@@ -753,6 +753,7 @@ 	vec3_t cur_loc;	/* The current location of the projectile. */ 	vec3_t impact;	/* The location of the target (-center?) */ 	vec3_t temp;+	vec3_t tracefrom;	/* sum */ 	trace_t tr;	/* the traceing */ 	float acc;	/* Accuracy modifier for the angle of the shot. */ 	float range;	/* ?? @todo */@@ -801,12 +802,13 @@ 		   defined by the fireDef_t. This is not really the impact location, 		   but rather the 'endofrange' location, see below for another use.*/ 		VectorMA(cur_loc, range, dir, impact);+		VectorCopy(cur_loc, tracefrom); 		/* Do the trace from current position of the projectile 		   to the end_of_range location.*/ 		/* FIXME: This trace doesn't seam to hit any func_breakable - why?? */ 		/* mins and maxs should be set via lm_t don't they? */-		tr = gi.trace(cur_loc, NULL, NULL, impact, ent, MASK_SHOT);+		tr = gi.trace(tracefrom, NULL, NULL, impact, ent, MASK_SHOT); 		/* _Now_ we copy the correct impact location. */ 		VectorCopy(tr.endpos, impact);@@ -867,6 +869,13 @@ 			break; 		}+		if (!fd->bounce && fd->throughWall) {+			if (trace.fraction == 1.0)+				break;+			VectorMA(trace.endpos, 1, dir, tracefrom);+			continue;+		}+ 		/* bounce is checked here to see if the rubber rocket hit walls enough times to wear out*/ 		bounce++; 		if (bounce > fd->bounce || tr.fraction >= 1.0)Index: src/game/q_shared.h===================================================================--- src/game/q_shared.h	(Revision 8374)+++ src/game/q_shared.h	(Arbeitskopie)@@ -1023,6 +1023,7 @@ 	qboolean launched; 	qboolean rolled;			/**< Can it be rolled - e.g. grenades */ 	qboolean reaction;			/**< This firemode can be used/selected for reaction fire.*/+	qboolean throughWall;		/**< allow the shooting throw a wall */ 	byte dmgtype; 	float speed; 	vec2_t shotOrg;Index: src/qcommon/scripts.c===================================================================--- src/qcommon/scripts.c	(Revision 8374)+++ src/qcommon/scripts.c	(Arbeitskopie)@@ -99,6 +99,7 @@ 	{"impsnd", V_STRING, offsetof(fireDef_t, impactSound), 0}, 	{"bodysnd", V_STRING, offsetof(fireDef_t, hitBodySound), 0}, 	{"bncsnd", V_STRING, offsetof(fireDef_t, bounceSound), 0},+	{"throughwall", V_BOOL, offsetof(fireDef_t, throughWall), MEMBER_SIZEOF(fireDef_t, throughWall)}, 	{"sndonce", V_BOOL, offsetof(fireDef_t, soundOnce), MEMBER_SIZEOF(fireDef_t, soundOnce)}, 	{"gravity", V_BOOL, offsetof(fireDef_t, gravity), MEMBER_SIZEOF(fireDef_t, gravity)}, 	{"launched", V_BOOL, offsetof(fireDef_t, launched), MEMBER_SIZEOF(fireDef_t, launched)},