[quake3-commits] r2063 - in trunk/code: cgame renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Jun 27 19:53:41 EDT 2011


Author: thilo
Date: 2011-06-27 19:53:40 -0400 (Mon, 27 Jun 2011)
New Revision: 2063

Modified:
   trunk/code/cgame/cg_ents.c
   trunk/code/cgame/cg_weapons.c
   trunk/code/renderer/tr_model.c
Log:
All patches by Zack Middleton:
- Bug 5057  - Two weapon number range checks allows invalid number
- Bug 5058  - Railgun explosion cannot be colorized
- Bug 5059  - Client's railgun does not glow in third person and mirror
- Bug 5060  - Warning in RAVENMD4 R_GetAnimTag cross compiling with amd64-mingw32


Modified: trunk/code/cgame/cg_ents.c
===================================================================
--- trunk/code/cgame/cg_ents.c	2011-06-27 20:22:32 UTC (rev 2062)
+++ trunk/code/cgame/cg_ents.c	2011-06-27 23:53:40 UTC (rev 2063)
@@ -410,7 +410,7 @@
 //	int	col;
 
 	s1 = &cent->currentState;
-	if ( s1->weapon > WP_NUM_WEAPONS ) {
+	if ( s1->weapon >= WP_NUM_WEAPONS ) {
 		s1->weapon = 0;
 	}
 	weapon = &cg_weapons[s1->weapon];
@@ -519,7 +519,7 @@
 	const weaponInfo_t		*weapon;
 
 	s1 = &cent->currentState;
-	if ( s1->weapon > WP_NUM_WEAPONS ) {
+	if ( s1->weapon >= WP_NUM_WEAPONS ) {
 		s1->weapon = 0;
 	}
 	weapon = &cg_weapons[s1->weapon];

Modified: trunk/code/cgame/cg_weapons.c
===================================================================
--- trunk/code/cgame/cg_weapons.c	2011-06-27 20:22:32 UTC (rev 2062)
+++ trunk/code/cgame/cg_weapons.c	2011-06-27 23:53:40 UTC (rev 2063)
@@ -1253,7 +1253,7 @@
 	gun.renderfx = parent->renderfx;
 
 	// set custom shading for railgun refire rate
-	if ( ps ) {
+	if ( ps || cent->currentState.clientNum == cg.predictedPlayerState.clientNum ) {
 		if ( cg.predictedPlayerState.weapon == WP_RAILGUN 
 			&& cg.predictedPlayerState.weaponstate == WEAPON_FIRING ) {
 			float	f;
@@ -1963,6 +1963,10 @@
 		if ( weapon == WP_RAILGUN ) {
 			// colorize with client color
 			VectorCopy( cgs.clientinfo[clientNum].color1, le->color );
+			le->refEntity.shaderRGBA[0] = le->color[0] * 0xff;
+			le->refEntity.shaderRGBA[1] = le->color[1] * 0xff;
+			le->refEntity.shaderRGBA[2] = le->color[2] * 0xff;
+			le->refEntity.shaderRGBA[3] = 0xff;
 		}
 	}
 

Modified: trunk/code/renderer/tr_model.c
===================================================================
--- trunk/code/renderer/tr_model.c	2011-06-27 20:22:32 UTC (rev 2062)
+++ trunk/code/renderer/tr_model.c	2011-06-27 23:53:40 UTC (rev 2063)
@@ -1160,7 +1160,7 @@
 
 			// uncompressed model...
 			//
-			frameSize = (long)( &((mdrFrame_t *)0)->bones[ mod->numBones ] );
+			frameSize = (intptr_t)( &((mdrFrame_t *)0)->bones[ mod->numBones ] );
 			frame = (mdrFrame_t *)((byte *)mod + mod->ofsFrames + framenum * frameSize );
 
 			for (j = 0; j < 3; j++)



More information about the quake3-commits mailing list