Sync CGame with ioquake3

Fix clientNum in engine/code/cgame/cg_players.c
Add \n to printf in engine/code/cgame/cg_snapshot.c
Misc whitespace and comment syncing to ioq3 in engine/code/cgame/
This commit is contained in:
zturtleman 2017-12-03 11:36:57 +00:00
parent c55f11d8b9
commit 7f60501f09
18 changed files with 209 additions and 319 deletions

View file

@ -738,4 +738,3 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("teamtask"); trap_AddCommand ("teamtask");
trap_AddCommand ("loaddefered"); // spelled wrong, but not changing for demo trap_AddCommand ("loaddefered"); // spelled wrong, but not changing for demo
} }

View file

@ -545,21 +545,18 @@ static void CG_DrawStatusBar( void ) {
vec4_t hcolor; vec4_t hcolor;
vec3_t angles; vec3_t angles;
vec3_t origin; vec3_t origin;
#ifdef MISSIONPACK
qhandle_t handle;
#endif
static float colors[4][4] = { static float colors[4][4] = {
// { 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} }; // { 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} };
{ 1.0f, 0.69f, 0.0f, 1.0f } , // normal { 1.0f, 0.69f, 0.0f, 1.0f }, // normal
{ 1.0f, 0.2f, 0.2f, 1.0f }, // low health { 1.0f, 0.2f, 0.2f, 1.0f }, // low health
{0.5f, 0.5f, 0.5f, 1.0f}, // weapon firing { 0.5f, 0.5f, 0.5f, 1.0f }, // weapon firing
{ 1.0f, 1.0f, 1.0f, 1.0f } }; // health > 100 { 1.0f, 1.0f, 1.0f, 1.0f } }; // health > 100
if ( cg_drawStatus.integer == 0 ) { if ( cg_drawStatus.integer == 0 ) {
return; return;
} }
// draw the team background // draw the team background
CG_DrawTeamBackground( 0, 420, 640, 60, 0.33f, cg.snap->ps.persistant[PERS_TEAM] ); CG_DrawTeamBackground( 0, 420, 640, 60, 0.33f, cg.snap->ps.persistant[PERS_TEAM] );
@ -596,20 +593,6 @@ static void CG_DrawStatusBar( void ) {
CG_Draw3DModel( 370 + CHAR_WIDTH*3 + TEXT_ICON_SPACE, 432, ICON_SIZE, ICON_SIZE, CG_Draw3DModel( 370 + CHAR_WIDTH*3 + TEXT_ICON_SPACE, 432, ICON_SIZE, ICON_SIZE,
cgs.media.armorModel, 0, origin, angles ); cgs.media.armorModel, 0, origin, angles );
} }
#ifdef MISSIONPACK
if( cgs.gametype == GT_HARVESTER ) {
origin[0] = 90;
origin[1] = 0;
origin[2] = -10;
angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0;
if( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) {
handle = cgs.media.redCubeModel;
} else {
handle = cgs.media.blueCubeModel;
}
CG_Draw3DModel( 640 - (TEXT_ICON_SPACE + ICON_SIZE), 416, ICON_SIZE, ICON_SIZE, handle, 0, origin, angles );
}
#endif
// //
// ammo // ammo
// //
@ -682,31 +665,7 @@ static void CG_DrawStatusBar( void ) {
} }
} }
#ifdef MISSIONPACK
//
// cubes
//
if( cgs.gametype == GT_HARVESTER ) {
value = ps->generic1;
if( value > 99 ) {
value = 99;
}
trap_R_SetColor( colors[0] );
CG_DrawField (640 - (CHAR_WIDTH*2 + TEXT_ICON_SPACE + ICON_SIZE), 432, 2, value);
trap_R_SetColor( NULL );
// if we didn't draw a 3D icon, draw a 2D icon for armor
if ( !cg_draw3dIcons.integer && cg_drawIcons.integer ) {
if( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) {
handle = cgs.media.redCubeIcon;
} else {
handle = cgs.media.blueCubeIcon;
}
CG_DrawPic( 640 - (TEXT_ICON_SPACE + ICON_SIZE), 432, ICON_SIZE, ICON_SIZE, handle );
}
}
#endif
} }
#endif #endif
@ -1872,7 +1831,7 @@ static float CG_DrawRallyPowerups( float y ) {
return y; return y;
} }
#endif #endif // MISSIONPACK
// Q3Rally Code END // Q3Rally Code END
@ -3153,9 +3112,6 @@ static void CG_DrawWarmup( void ) {
*/ */
// Q3Rally Code END // Q3Rally Code END
//================================================================================== //==================================================================================
#ifdef MISSIONPACK #ifdef MISSIONPACK
/* /*
@ -3266,7 +3222,6 @@ static void CG_Draw2D(stereoFrame_t stereoFrame)
CG_DrawLagometer(); CG_DrawLagometer();
#ifdef MISSIONPACK #ifdef MISSIONPACK
if (!cg_paused.integer) { if (!cg_paused.integer) {
CG_DrawUpperRight(stereoFrame); CG_DrawUpperRight(stereoFrame);
@ -3358,4 +3313,3 @@ void CG_DrawActive( stereoFrame_t stereoView ) {

View file

@ -458,11 +458,6 @@ void CG_ColorForHealth( vec4_t hcolor ) {
} }
// bk001205 - code below duplicated in q3_ui/ui-atoms.c
// bk001205 - FIXME: does this belong in ui_shared.c?
// bk001205 - FIXME: HARD_LINKED flags not visible here
#ifndef Q3_STATIC // bk001205 - q_shared defines not visible here
/* /*
================= =================
UI_DrawProportionalString2 UI_DrawProportionalString2
@ -769,7 +764,7 @@ UI_DrawBannerString
static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color ) static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
{ {
const char* s; const char* s;
unsigned char ch; // bk001204 : array subscript unsigned char ch;
float ax; float ax;
float ay; float ay;
float aw; float aw;
@ -879,7 +874,7 @@ int UI_ProportionalStringWidth( const char* str ) {
static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t color, float sizeScale, qhandle_t charset ) static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t color, float sizeScale, qhandle_t charset )
{ {
const char* s; const char* s;
unsigned char ch; // bk001204 - unsigned unsigned char ch;
float ax; float ax;
float ay; float ay;
float aw; float aw;
@ -893,7 +888,7 @@ static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t co
trap_R_SetColor( color ); trap_R_SetColor( color );
ax = x * cgs.screenXScale + cgs.screenXBias; ax = x * cgs.screenXScale + cgs.screenXBias;
ay = y * cgs.screenXScale; ay = y * cgs.screenYScale;
s = str; s = str;
while ( *s ) while ( *s )
@ -994,4 +989,3 @@ void UI_DrawProportionalString( int x, int y, const char* str, int style, vec4_t
UI_DrawProportionalString2( x, y, str, color, sizeScale, cgs.media.charsetProp ); UI_DrawProportionalString2( x, y, str, color, sizeScale, cgs.media.charsetProp );
} }
#endif // Q3STATIC

View file

@ -132,7 +132,7 @@ static void CG_EntityEffects( centity_t *cent ) {
CG_SetEntitySoundPosition( cent ); CG_SetEntitySoundPosition( cent );
// add loop sound // add loop sound
if ( cent->currentState.loopSound) { if ( cent->currentState.loopSound ) {
if (cent->currentState.eType != ET_SPEAKER) { if (cent->currentState.eType != ET_SPEAKER) {
trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin, trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
cgs.gameSounds[ cent->currentState.loopSound ] ); cgs.gameSounds[ cent->currentState.loopSound ] );
@ -538,7 +538,6 @@ static void CG_Missile( centity_t *cent ) {
return; return;
} }
// Q3Rally Code Start // Q3Rally Code Start
if (cent->currentState.weapon == RWP_MINE){ if (cent->currentState.weapon == RWP_MINE){
if (cgs.gametype >= GT_TEAM){ if (cgs.gametype >= GT_TEAM){

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h" #include "cg_local.h"
// for the voice chats // for the voice chats
#ifdef MISSIONPACK // bk001205 #ifdef MISSIONPACK
#include "../../ui/menudef.h" #include "../../ui/menudef.h"
#endif #endif
//========================================================================== //==========================================================================
@ -1091,7 +1091,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
} }
break; break;
#ifdef MISSIONPACK #ifdef MISSIONPACK
case EV_PROXIMITY_MINE_STICK: case EV_PROXIMITY_MINE_STICK:
DEBUGNAME("EV_PROXIMITY_MINE_STICK"); DEBUGNAME("EV_PROXIMITY_MINE_STICK");
@ -1325,7 +1324,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
} }
case EV_PAIN: case EV_PAIN:
// local player sounds are triggered in CG_CheckLocalSounds, // local player sounds are triggered in CG_CheckLocalSounds,
// so ignore events on the player // so ignore events on the player
DEBUGNAME("EV_PAIN"); DEBUGNAME("EV_PAIN");
@ -1417,8 +1415,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
// Q3Rally Code END // Q3Rally Code END
break; break;
case EV_STOPLOOPINGSOUND: case EV_STOPLOOPINGSOUND:
DEBUGNAME("EV_STOPLOOPINGSOUND"); DEBUGNAME("EV_STOPLOOPINGSOUND");
trap_S_StopLoopingSound( es->number ); trap_S_StopLoopingSound( es->number );
@ -1518,6 +1514,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
CG_Error( "Unknown event: %i", event ); CG_Error( "Unknown event: %i", event );
break; break;
} }
} }

View file

@ -419,7 +419,6 @@ static cvarTable_t cvarTable[] = {
{ &cg_smoothClients, "cg_smoothClients", "0", CVAR_USERINFO | CVAR_ARCHIVE}, { &cg_smoothClients, "cg_smoothClients", "0", CVAR_USERINFO | CVAR_ARCHIVE},
{ &cg_cameraMode, "com_cameraMode", "0", CVAR_CHEAT}, { &cg_cameraMode, "com_cameraMode", "0", CVAR_CHEAT},
{ &pmove_fixed, "pmove_fixed", "0", CVAR_SYSTEMINFO}, { &pmove_fixed, "pmove_fixed", "0", CVAR_SYSTEMINFO},
{ &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO}, { &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO},
#ifdef MISSIONPACK #ifdef MISSIONPACK
@ -431,7 +430,7 @@ static cvarTable_t cvarTable[] = {
{ &cg_oldRail, "cg_oldRail", "1", CVAR_ARCHIVE}, { &cg_oldRail, "cg_oldRail", "1", CVAR_ARCHIVE},
{ &cg_oldRocket, "cg_oldRocket", "1", CVAR_ARCHIVE}, { &cg_oldRocket, "cg_oldRocket", "1", CVAR_ARCHIVE},
{ &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE}, { &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE},
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}, { &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}
// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE } // { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
}; };
@ -559,9 +558,6 @@ void QDECL CG_Error( const char *msg, ... ) {
trap_Error( text ); trap_Error( text );
} }
#ifndef CGAME_HARD_LINKED
// this is only here so the functions in q_shared.c and bg_*.c can link (FIXME)
void QDECL Com_Error( int level, const char *error, ... ) { void QDECL Com_Error( int level, const char *error, ... ) {
va_list argptr; va_list argptr;
char text[1024]; char text[1024];
@ -584,8 +580,6 @@ void QDECL Com_Printf( const char *msg, ... ) {
trap_Print( text ); trap_Print( text );
} }
#endif
/* /*
================ ================
CG_Argv CG_Argv

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
=========================================================================== ===========================================================================
*/ */
#ifndef MISSIONPACK // bk001204 #ifndef MISSIONPACK
#error This file not be used for classic Q3A. #error This file not be used for classic Q3A.
#endif #endif
@ -41,7 +41,7 @@ int drawTeamOverlayModificationCount = -1;
//static char teamChat1[256]; //static char teamChat1[256];
//static char teamChat2[256]; //static char teamChat2[256];
void CG_InitTeamChat() { void CG_InitTeamChat(void) {
memset(teamChat1, 0, sizeof(teamChat1)); memset(teamChat1, 0, sizeof(teamChat1));
memset(teamChat2, 0, sizeof(teamChat2)); memset(teamChat2, 0, sizeof(teamChat2));
memset(systemChat, 0, sizeof(systemChat)); memset(systemChat, 0, sizeof(systemChat));
@ -56,7 +56,7 @@ void CG_SetPrintString(int type, const char *p) {
} }
} }
void CG_CheckOrderPending() { void CG_CheckOrderPending(void) {
if (cgs.gametype < GT_CTF) { if (cgs.gametype < GT_CTF) {
return; return;
} }
@ -120,7 +120,7 @@ void CG_CheckOrderPending() {
} }
} }
static void CG_SetSelectedPlayerName() { static void CG_SetSelectedPlayerName( void ) {
if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) { if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) {
clientInfo_t *ci = cgs.clientinfo + sortedTeamPlayers[cg_currentSelectedPlayer.integer]; clientInfo_t *ci = cgs.clientinfo + sortedTeamPlayers[cg_currentSelectedPlayer.integer];
if (ci) { if (ci) {
@ -132,14 +132,14 @@ static void CG_SetSelectedPlayerName() {
trap_Cvar_Set("cg_selectedPlayerName", "Everyone"); trap_Cvar_Set("cg_selectedPlayerName", "Everyone");
} }
} }
int CG_GetSelectedPlayer() { int CG_GetSelectedPlayer( void ) {
if (cg_currentSelectedPlayer.integer < 0 || cg_currentSelectedPlayer.integer >= numSortedTeamPlayers) { if (cg_currentSelectedPlayer.integer < 0 || cg_currentSelectedPlayer.integer >= numSortedTeamPlayers) {
cg_currentSelectedPlayer.integer = 0; cg_currentSelectedPlayer.integer = 0;
} }
return cg_currentSelectedPlayer.integer; return cg_currentSelectedPlayer.integer;
} }
void CG_SelectNextPlayer() { void CG_SelectNextPlayer( void ) {
CG_CheckOrderPending(); CG_CheckOrderPending();
if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) { if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) {
cg_currentSelectedPlayer.integer++; cg_currentSelectedPlayer.integer++;
@ -149,7 +149,7 @@ void CG_SelectNextPlayer() {
CG_SetSelectedPlayerName(); CG_SetSelectedPlayerName();
} }
void CG_SelectPrevPlayer() { void CG_SelectPrevPlayer( void ) {
CG_CheckOrderPending(); CG_CheckOrderPending();
if (cg_currentSelectedPlayer.integer > 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) { if (cg_currentSelectedPlayer.integer > 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) {
cg_currentSelectedPlayer.integer--; cg_currentSelectedPlayer.integer--;
@ -168,15 +168,14 @@ static void CG_DrawPlayerArmorIcon( rectDef_t *rect, qboolean draw2D ) {
return; return;
} }
if ( draw2D || !cg_draw3dIcons.integer && cg_drawIcons.integer ) { if ( draw2D || ( !cg_draw3dIcons.integer && cg_drawIcons.integer) ) {
CG_DrawPic( rect->x, rect->y + rect->h/2 + 1, rect->w, rect->h, cgs.media.armorIcon ); CG_DrawPic( rect->x, rect->y + rect->h/2 + 1, rect->w, rect->h, cgs.media.armorIcon );
} else if (cg_draw3dIcons.integer) { } else if (cg_draw3dIcons.integer) {
VectorClear( angles ); VectorClear( angles );
origin[0] = 90; origin[0] = 90;
origin[1] = 0; origin[1] = 0;
origin[2] = -10; origin[2] = -10;
angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0; angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0f;
CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cgs.media.armorModel, 0, origin, angles ); CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cgs.media.armorModel, 0, origin, angles );
} }
} }
@ -208,7 +207,7 @@ static void CG_DrawPlayerAmmoIcon( rectDef_t *rect, qboolean draw2D ) {
cent = &cg_entities[cg.snap->ps.clientNum]; cent = &cg_entities[cg.snap->ps.clientNum];
if ( draw2D || !cg_draw3dIcons.integer && cg_drawIcons.integer ) { if ( draw2D || (!cg_draw3dIcons.integer && cg_drawIcons.integer) ) {
qhandle_t icon; qhandle_t icon;
icon = cg_weapons[ cg.predictedPlayerState.weapon ].ammoIcon; icon = cg_weapons[ cg.predictedPlayerState.weapon ].ammoIcon;
if ( icon ) { if ( icon ) {
@ -792,6 +791,10 @@ static void CG_OneFlagStatus(rectDef_t *rect) {
static void CG_DrawCTFPowerUp(rectDef_t *rect) { static void CG_DrawCTFPowerUp(rectDef_t *rect) {
int value; int value;
if (cgs.gametype < GT_CTF) {
return;
}
value = cg.snap->ps.stats[STAT_PERSISTANT_POWERUP]; value = cg.snap->ps.stats[STAT_PERSISTANT_POWERUP];
if ( value ) { if ( value ) {
CG_RegisterItemVisuals( value ); CG_RegisterItemVisuals( value );
@ -935,7 +938,7 @@ float CG_GetValue(int ownerDraw) {
return -1; return -1;
} }
qboolean CG_OtherTeamHasFlag() { qboolean CG_OtherTeamHasFlag(void) {
if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) { if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) {
int team = cg.snap->ps.persistant[PERS_TEAM]; int team = cg.snap->ps.persistant[PERS_TEAM];
if (cgs.gametype == GT_1FCTF) { if (cgs.gametype == GT_1FCTF) {
@ -959,7 +962,7 @@ qboolean CG_OtherTeamHasFlag() {
return qfalse; return qfalse;
} }
qboolean CG_YourTeamHasFlag() { qboolean CG_YourTeamHasFlag(void) {
if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) { if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) {
int team = cg.snap->ps.persistant[PERS_TEAM]; int team = cg.snap->ps.persistant[PERS_TEAM];
if (cgs.gametype == GT_1FCTF) { if (cgs.gametype == GT_1FCTF) {
@ -1061,7 +1064,7 @@ qboolean CG_OwnerDrawVisible(int flags) {
} }
if (flags & CG_SHOW_HEALTHOK) { if (flags & CG_SHOW_HEALTHOK) {
if (cg.snap->ps.stats[STAT_HEALTH] > 25) { if (cg.snap->ps.stats[STAT_HEALTH] >= 25) {
return qtrue; return qtrue;
} }
} }
@ -1114,7 +1117,7 @@ static void CG_DrawAreaChat(rectDef_t *rect, float scale, vec4_t color, qhandle_
CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, teamChat2, 0, 0, 0); CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, teamChat2, 0, 0, 0);
} }
const char *CG_GetKillerText() { const char *CG_GetKillerText(void) {
const char *s = ""; const char *s = "";
if ( cg.killerName[0] ) { if ( cg.killerName[0] ) {
s = va("Fragged by %s", cg.killerName ); s = va("Fragged by %s", cg.killerName );
@ -1150,7 +1153,7 @@ static void CG_Draw2ndPlace(rectDef_t *rect, float scale, vec4_t color, qhandle_
} }
} }
const char *CG_GetGameStatusText() { const char *CG_GetGameStatusText(void) {
const char *s = ""; const char *s = "";
if ( cgs.gametype < GT_TEAM) { if ( cgs.gametype < GT_TEAM) {
if (cg.snap->ps.persistant[PERS_TEAM] != TEAM_SPECTATOR ) { if (cg.snap->ps.persistant[PERS_TEAM] != TEAM_SPECTATOR ) {
@ -1197,7 +1200,7 @@ static void CG_DrawGameStatus(rectDef_t *rect, float scale, vec4_t color, qhandl
CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, CG_GetGameStatusText(), 0, 0, textStyle); CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, CG_GetGameStatusText(), 0, 0, textStyle);
} }
const char *CG_GameTypeString() { const char *CG_GameTypeString(void) {
if ( cgs.gametype == GT_FFA ) { if ( cgs.gametype == GT_FFA ) {
return "Free For All"; return "Free For All";
} else if ( cgs.gametype == GT_TEAM ) { } else if ( cgs.gametype == GT_TEAM ) {
@ -1749,7 +1752,7 @@ CG_HideTeamMenus
================== ==================
*/ */
void CG_HideTeamMenu() { void CG_HideTeamMenu( void ) {
Menus_CloseByName("teamMenu"); Menus_CloseByName("teamMenu");
Menus_CloseByName("getMenu"); Menus_CloseByName("getMenu");
} }
@ -1760,7 +1763,7 @@ CG_ShowTeamMenus
================== ==================
*/ */
void CG_ShowTeamMenu() { void CG_ShowTeamMenu( void ) {
Menus_OpenByName("teamMenu"); Menus_OpenByName("teamMenu");
} }
@ -1830,7 +1833,7 @@ int CG_ClientNumFromName(const char *p) {
return -1; return -1;
} }
void CG_ShowResponseHead() { void CG_ShowResponseHead(void) {
Menus_OpenByName("voiceMenu"); Menus_OpenByName("voiceMenu");
trap_Cvar_Set("cl_conXOffset", "72"); trap_Cvar_Set("cl_conXOffset", "72");
cg.voiceTime = cg.time; cg.voiceTime = cg.time;
@ -1842,17 +1845,17 @@ void CG_RunMenuScript(char **args) {
void CG_GetTeamColor(vec4_t *color) { void CG_GetTeamColor(vec4_t *color) {
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) { if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) {
(*color)[0] = 1; (*color)[0] = 1.0f;
(*color)[3] = .25f; (*color)[3] = 0.25f;
(*color)[1] = (*color)[2] = 0; (*color)[1] = (*color)[2] = 0.0f;
} else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) { } else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) {
(*color)[0] = (*color)[1] = 0; (*color)[0] = (*color)[1] = 0.0f;
(*color)[2] = 1; (*color)[2] = 1.0f;
(*color)[3] = .25f; (*color)[3] = 0.25f;
} else { } else {
(*color)[0] = (*color)[2] = 0; (*color)[0] = (*color)[2] = 0.0f;
(*color)[1] = .17f; (*color)[1] = 0.17f;
(*color)[3] = .25f; (*color)[3] = 0.25f;
} }
} }

View file

@ -15,7 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Foobar; if not, write to the Free Software along with Quake III Arena source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
=========================================================================== ===========================================================================
*/ */

View file

@ -48,6 +48,7 @@ char *cg_customSoundNames[MAX_CUSTOM_SOUNDS] = {
"*pain50_1.wav", "*pain50_1.wav",
"*pain75_1.wav", "*pain75_1.wav",
"*pain100_1.wav", "*pain100_1.wav",
"*falling1.wav",
"*gasp.wav", "*gasp.wav",
"*drown.wav", "*drown.wav",
"*fall1.wav", "*fall1.wav",
@ -126,6 +127,7 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
} }
if ( len >= sizeof( text ) - 1 ) { if ( len >= sizeof( text ) - 1 ) {
CG_Printf( "File %s too long\n", filename ); CG_Printf( "File %s too long\n", filename );
trap_FS_FCloseFile( f );
return qfalse; return qfalse;
} }
trap_FS_Read( text, len, f ); trap_FS_Read( text, len, f );
@ -204,6 +206,7 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
} }
if ( len >= sizeof( text ) - 1 ) { if ( len >= sizeof( text ) - 1 ) {
CG_Printf( "File %s too long\n", filename ); CG_Printf( "File %s too long\n", filename );
trap_FS_FCloseFile( f );
return qfalse; return qfalse;
} }
trap_FS_Read( text, len, f ); trap_FS_Read( text, len, f );
@ -399,7 +402,7 @@ CG_FileExists
static qboolean CG_FileExists(const char *filename) { static qboolean CG_FileExists(const char *filename) {
int len; int len;
len = trap_FS_FOpenFile( filename, 0, FS_READ ); len = trap_FS_FOpenFile( filename, NULL, FS_READ );
if (len>0) { if (len>0) {
return qtrue; return qtrue;
} }
@ -934,11 +937,10 @@ Load it now, taking the disk hits.
This will usually be deferred to a safe time This will usually be deferred to a safe time
=================== ===================
*/ */
static void CG_LoadClientInfo( clientInfo_t *ci ) { static void CG_LoadClientInfo( int clientNum, clientInfo_t *ci ) {
const char *dir, *fallback; const char *dir, *fallback;
int i, modelloaded; int i, modelloaded;
const char *s; const char *s;
int clientNum;
char teamname[MAX_QPATH]; char teamname[MAX_QPATH];
teamname[0] = 0; teamname[0] = 0;
@ -1047,7 +1049,6 @@ static void CG_LoadClientInfo( clientInfo_t *ci ) {
// reset any existing players and bodies, because they might be in bad // reset any existing players and bodies, because they might be in bad
// frames for this new model // frames for this new model
clientNum = ci - cgs.clientinfo;
for ( i = 0 ; i < MAX_GENTITIES ; i++ ) { for ( i = 0 ; i < MAX_GENTITIES ; i++ ) {
if ( cg_entities[i].currentState.clientNum == clientNum if ( cg_entities[i].currentState.clientNum == clientNum
&& cg_entities[i].currentState.eType == ET_PLAYER ) { && cg_entities[i].currentState.eType == ET_PLAYER ) {
@ -1148,7 +1149,7 @@ We aren't going to load it now, so grab some other
client's info to use until we have some spare time. client's info to use until we have some spare time.
====================== ======================
*/ */
static void CG_SetDeferredClientInfo( clientInfo_t *ci ) { static void CG_SetDeferredClientInfo( int clientNum, clientInfo_t *ci ) {
int i; int i;
clientInfo_t *match; clientInfo_t *match;
@ -1172,7 +1173,7 @@ static void CG_SetDeferredClientInfo( clientInfo_t *ci ) {
} }
// just load the real info cause it uses the same models and skins // just load the real info cause it uses the same models and skins
CG_LoadClientInfo( ci ); CG_LoadClientInfo( clientNum, ci );
return; return;
} }
@ -1195,7 +1196,7 @@ static void CG_SetDeferredClientInfo( clientInfo_t *ci ) {
// an improper team skin. This will cause a hitch for the first // an improper team skin. This will cause a hitch for the first
// player, when the second enters. Combat shouldn't be going on // player, when the second enters. Combat shouldn't be going on
// yet, so it shouldn't matter // yet, so it shouldn't matter
CG_LoadClientInfo( ci ); CG_LoadClientInfo( clientNum, ci );
return; return;
} }
@ -1214,7 +1215,7 @@ static void CG_SetDeferredClientInfo( clientInfo_t *ci ) {
// we should never get here... // we should never get here...
CG_Printf( "CG_SetDeferredClientInfo: no valid clients!\n" ); CG_Printf( "CG_SetDeferredClientInfo: no valid clients!\n" );
CG_LoadClientInfo( ci ); CG_LoadClientInfo( clientNum, ci );
} }
@ -1446,17 +1447,16 @@ void CG_NewClientInfo( int clientNum ) {
forceDefer = trap_MemoryRemaining() < 4000000; forceDefer = trap_MemoryRemaining() < 4000000;
// if we are defering loads, just have it pick the first valid // if we are defering loads, just have it pick the first valid
if ( forceDefer || ( cg_deferPlayers.integer && !cg_buildScript.integer && !cg.loading ) ) { if ( forceDefer || (cg_deferPlayers.integer && !cg_buildScript.integer && !cg.loading ) ) {
// keep whatever they had if it won't violate team skins // keep whatever they had if it won't violate team skins
CG_SetDeferredClientInfo( &newInfo ); CG_SetDeferredClientInfo( clientNum, &newInfo );
// if we are low on memory, leave them with this model // if we are low on memory, leave them with this model
if ( forceDefer ) { if ( forceDefer ) {
CG_Printf( "Memory is low. Using deferred model.\n" ); CG_Printf( "Memory is low. Using deferred model.\n" );
newInfo.deferred = qfalse; newInfo.deferred = qfalse;
} }
} else { } else {
CG_LoadClientInfo( &newInfo ); CG_LoadClientInfo( clientNum, &newInfo );
} }
} }
@ -1489,7 +1489,7 @@ void CG_LoadDeferredPlayers( void ) {
ci->deferred = qfalse; ci->deferred = qfalse;
continue; continue;
} }
CG_LoadClientInfo( ci ); CG_LoadClientInfo( i, ci );
// break; // break;
} }
} }
@ -1850,6 +1850,7 @@ static void CG_PlayerAngles( centity_t *cent, vec3_t legs[3], vec3_t torso[3], v
torsoAngles[YAW] = cent->pe.torso.yawAngle; torsoAngles[YAW] = cent->pe.torso.yawAngle;
legsAngles[YAW] = cent->pe.legs.yawAngle; legsAngles[YAW] = cent->pe.legs.yawAngle;
// --------- pitch ------------- // --------- pitch -------------
// only show a fraction of the pitch angle in the torso // only show a fraction of the pitch angle in the torso
@ -1914,6 +1915,7 @@ static void CG_PlayerAngles( centity_t *cent, vec3_t legs[3], vec3_t torso[3], v
*/ */
// END // END
//========================================================================== //==========================================================================
/* /*
@ -2202,7 +2204,7 @@ static void CG_PlayerFlag( centity_t *cent, qhandle_t hSkin, refEntity_t *torso
} }
#ifdef MISSIONPACK // bk001204 #ifdef MISSIONPACK
/* /*
=============== ===============
CG_PlayerTokens CG_PlayerTokens
@ -2588,7 +2590,7 @@ static qboolean CG_PlayerShadow( centity_t *cent, float *shadowPlane ) {
// fade the shadow out with height // fade the shadow out with height
alpha = 1.0 - trace.fraction; alpha = 1.0 - trace.fraction;
// bk0101022 - hack / FPE - bogus planes? // hack / FPE - bogus planes?
//assert( DotProduct( trace.plane.normal, trace.plane.normal ) != 0.0f ) //assert( DotProduct( trace.plane.normal, trace.plane.normal ) != 0.0f )
// add the mark as a temporary, so it goes directly to the renderer // add the mark as a temporary, so it goes directly to the renderer
@ -3486,7 +3488,8 @@ void CG_Player( centity_t *cent ) {
CG_PlayerEngineSmoke(cent, &body); CG_PlayerEngineSmoke(cent, &body);
// END // END
/* Q3Rally Code Start // Q3Rally Code Start
#if 0
// //
// add the legs // add the legs
// //
@ -3572,12 +3575,14 @@ void CG_Player( centity_t *cent ) {
angles[2] = 0; angles[2] = 0;
AnglesToAxis( angles, skull.axis ); AnglesToAxis( angles, skull.axis );
// dir[2] = 0; /*
// VectorInverse(dir); dir[2] = 0;
// VectorCopy(dir, skull.axis[1]); VectorInverse(dir);
// VectorNormalize(skull.axis[1]); VectorCopy(dir, skull.axis[1]);
// VectorSet(skull.axis[2], 0, 0, 1); VectorNormalize(skull.axis[1]);
// CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]); VectorSet(skull.axis[2], 0, 0, 1);
CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]);
*/
skull.hModel = cgs.media.kamikazeHeadModel; skull.hModel = cgs.media.kamikazeHeadModel;
trap_R_AddRefEntityToScene( &skull ); trap_R_AddRefEntityToScene( &skull );
@ -3601,11 +3606,13 @@ void CG_Player( centity_t *cent ) {
angles[2] = 0; angles[2] = 0;
AnglesToAxis( angles, skull.axis ); AnglesToAxis( angles, skull.axis );
// dir[2] = 0; /*
// VectorCopy(dir, skull.axis[1]); dir[2] = 0;
// VectorNormalize(skull.axis[1]); VectorCopy(dir, skull.axis[1]);
// VectorSet(skull.axis[2], 0, 0, 1); VectorNormalize(skull.axis[1]);
// CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]); VectorSet(skull.axis[2], 0, 0, 1);
CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]);
*/
skull.hModel = cgs.media.kamikazeHeadModel; skull.hModel = cgs.media.kamikazeHeadModel;
trap_R_AddRefEntityToScene( &skull ); trap_R_AddRefEntityToScene( &skull );
@ -3729,10 +3736,13 @@ void CG_Player( centity_t *cent ) {
trap_R_AddRefEntityToScene( &powerup ); trap_R_AddRefEntityToScene( &powerup );
} }
#endif // MISSIONPACK #endif // MISSIONPACK
*/ #endif // Q3Rally
// STONELANCE( add head support ) // STONELANCE( add head support )
/* /*
//
// add the head
//
head.hModel = ci->headModel; head.hModel = ci->headModel;
if (!head.hModel) { if (!head.hModel) {
return; return;
@ -3997,6 +4007,7 @@ void CG_Player( centity_t *cent ) {
// add the gun / barrel / flash // add the gun / barrel / flash
// //
// Q3Rally Code Start // Q3Rally Code Start
// CG_AddPlayerWeapon( &torso, NULL, cent, ci->team );
CG_AddPlayerWeapon( &body, NULL, cent, ci->team ); CG_AddPlayerWeapon( &body, NULL, cent, ci->team );
// END // END

View file

@ -226,7 +226,6 @@ void CG_CheckPlayerstateEvents( playerState_t *ps, playerState_t *ops ) {
cent = &cg_entities[ ps->clientNum ]; cent = &cg_entities[ ps->clientNum ];
cent->currentState.event = ps->externalEvent; cent->currentState.event = ps->externalEvent;
cent->currentState.eventParm = ps->externalEventParm; cent->currentState.eventParm = ps->externalEventParm;
CG_EntityEvent( cent, cent->lerpOrigin ); CG_EntityEvent( cent, cent->lerpOrigin );
} }
@ -515,7 +514,7 @@ void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops ) {
// STONELANCE using damagePitch and Yaw for view // STONELANCE using damagePitch and Yaw for view
/* /*
if ( ps->damageEvent != ops->damageEvent && ps->damageCount ) { if ( ps->damageEvent != ops->damageEvent && ps->damageCount ) {
CG_DamageFeedback( ps->damageYaw, ps->damagePitch, ps->damageCount ); // CG_DamageFeedback( ps->damageYaw, ps->damagePitch, ps->damageCount );
CG_DamageFeedback( 0, 0, ps->damageCount ); CG_DamageFeedback( 0, 0, ps->damageCount );
} }
*/ */

View file

@ -237,4 +237,3 @@ typedef enum {
} cgameExport_t; } cgameExport_t;
//---------------------------------------------- //----------------------------------------------

View file

@ -1,54 +0,0 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2002-2015 Q3Rally Team (Per Thormann - q3rally@gmail.com)
This file is part of q3rally source code.
q3rally source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
q3rally source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with q3rally; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "cg_local.h"
/*
================
CG_RankRunFrame
================
*/
void CG_RankRunFrame(void)
{
grank_status_t status;
if (! cgs.localServer)
trap_CL_RankPoll();
status = trap_CL_RankUserStatus();
if( cgs.client_status != status )
{
// GRank status changed
// inform UI of current status
trap_Cvar_Set("client_status", va("%i",(int)(status)));
// show rankings status dialog if error
trap_CL_RankShowStatus((int)status);
cgs.client_status = status;
}
return;
}

View file

@ -91,6 +91,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
static qboolean localClient; // true if local client has been displayed static qboolean localClient; // true if local client has been displayed
/* /*
================= =================
CG_DrawScoreboard CG_DrawScoreboard
@ -692,6 +693,8 @@ void CG_DrawTourneyScoreboard( void ) {
y += 64; y += 64;
} }
} }
} }
#endif #endif
// END // END

View file

@ -263,7 +263,6 @@ void CG_SetConfigValues( void ) {
cgs.redflag = s[0] - '0'; cgs.redflag = s[0] - '0';
cgs.blueflag = s[1] - '0'; cgs.blueflag = s[1] - '0';
} }
#ifdef MISSIONPACK #ifdef MISSIONPACK
else if( cgs.gametype == GT_1FCTF ) { else if( cgs.gametype == GT_1FCTF ) {
s = CG_ConfigString( CS_FLAGSTATUS ); s = CG_ConfigString( CS_FLAGSTATUS );
@ -343,15 +342,13 @@ static void CG_ConfigStringModified( void ) {
cgs.scores1 = atoi( str ); cgs.scores1 = atoi( str );
} else if ( num == CS_SCORES2 ) { } else if ( num == CS_SCORES2 ) {
cgs.scores2 = atoi( str ); cgs.scores2 = atoi( str );
}
// Q3Rally Code Start // Q3Rally Code Start
else if ( num == CS_SCORES3 ) { } else if ( num == CS_SCORES3 ) {
cgs.scores3 = atoi( str ); cgs.scores3 = atoi( str );
} else if ( num == CS_SCORES4 ) { } else if ( num == CS_SCORES4 ) {
cgs.scores4 = atoi( str ); cgs.scores4 = atoi( str );
}
// END // END
else if ( num == CS_LEVEL_START_TIME ) { } else if ( num == CS_LEVEL_START_TIME ) {
cgs.levelStartTime = atoi( str ); cgs.levelStartTime = atoi( str );
} else if ( num == CS_VOTE_TIME ) { } else if ( num == CS_VOTE_TIME ) {
cgs.voteTime = atoi( str ); cgs.voteTime = atoi( str );
@ -404,8 +401,6 @@ static void CG_ConfigStringModified( void ) {
} }
#endif #endif
} }
else if ( num == CS_SHADERSTATE ) { else if ( num == CS_SHADERSTATE ) {
CG_ShaderStateChanged(); CG_ShaderStateChanged();
} }
@ -1293,4 +1288,3 @@ void CG_ExecuteNewServerCommands( int latestSequence ) {
} }
} }
} }

View file

@ -267,7 +267,7 @@ static snapshot_t *CG_ReadNextSnapshot( void ) {
snapshot_t *dest; snapshot_t *dest;
if ( cg.latestSnapshotNum > cgs.processedSnapshotNum + 1000 ) { if ( cg.latestSnapshotNum > cgs.processedSnapshotNum + 1000 ) {
CG_Printf( "WARNING: CG_ReadNextSnapshot: way out of range, %i > %i", CG_Printf( "WARNING: CG_ReadNextSnapshot: way out of range, %i > %i\n",
cg.latestSnapshotNum, cgs.processedSnapshotNum ); cg.latestSnapshotNum, cgs.processedSnapshotNum );
} }

View file

@ -292,6 +292,7 @@ static void CG_OffsetThirdPersonView( void ) {
} }
} }
VectorCopy( view, cg.refdef.vieworg ); VectorCopy( view, cg.refdef.vieworg );
// select pitch to look at focus point from vieword // select pitch to look at focus point from vieword
@ -641,7 +642,6 @@ static int CG_CalcViewValues( void ) {
CG_CalcVrect(); CG_CalcVrect();
ps = &cg.predictedPlayerState; ps = &cg.predictedPlayerState;
/* /*
if (cg.cameraMode) { if (cg.cameraMode) {
vec3_t origin, angles; vec3_t origin, angles;

View file

@ -226,13 +226,6 @@ void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
#define SPACING 5 #define SPACING 5
start[2] -= 4; start[2] -= 4;
VectorCopy (start, move);
VectorSubtract (end, start, vec);
len = VectorNormalize (vec);
PerpendicularVector(temp, vec);
for (i = 0 ; i < 36; i++) {
RotatePointAroundVector(axis[i], vec, temp, i * 10);//banshee 2.4 was 10
}
le = CG_AllocLocalEntity(); le = CG_AllocLocalEntity();
re = &le->refEntity; re = &le->refEntity;
@ -261,20 +254,33 @@ void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
AxisClear( re->axis ); AxisClear( re->axis );
VectorMA(move, 20, vec, move); if (cg_oldRail.integer)
VectorScale (vec, SPACING, vec); {
if (cg_oldRail.integer != 0) {
// nudge down a bit so it isn't exactly in center // nudge down a bit so it isn't exactly in center
re->origin[2] -= 8; re->origin[2] -= 8;
re->oldorigin[2] -= 8; re->oldorigin[2] -= 8;
return; return;
} }
VectorCopy (start, move);
VectorSubtract (end, start, vec);
len = VectorNormalize (vec);
PerpendicularVector(temp, vec);
for (i = 0 ; i < 36; i++)
{
RotatePointAroundVector(axis[i], vec, temp, i * 10);//banshee 2.4 was 10
}
VectorMA(move, 20, vec, move);
VectorScale (vec, SPACING, vec);
skip = -1; skip = -1;
j = 18; j = 18;
for (i = 0; i < len; i += SPACING) { for (i = 0; i < len; i += SPACING)
if (i != skip) { {
if (i != skip)
{
skip = i + SPACING; skip = i + SPACING;
le = CG_AllocLocalEntity(); le = CG_AllocLocalEntity();
re = &le->refEntity; re = &le->refEntity;
@ -313,7 +319,7 @@ void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
VectorAdd (move, vec, move); VectorAdd (move, vec, move);
j = j + ROTATION < 36 ? j + ROTATION : (j + ROTATION) % 36; j = (j + ROTATION) % 36;
} }
} }
@ -453,7 +459,6 @@ static void CG_NailTrail( centity_t *ent, const weaponInfo_t *wi ) {
} }
#endif #endif
/* /*
========================== ==========================
CG_PlasmaTrail CG_PlasmaTrail
@ -542,8 +547,8 @@ static void CG_PlasmaTrail( centity_t *cent, const weaponInfo_t *wi ) {
le->angles.trDelta[0] = 1; le->angles.trDelta[0] = 1;
le->angles.trDelta[1] = 0.5; le->angles.trDelta[1] = 0.5;
le->angles.trDelta[2] = 0; le->angles.trDelta[2] = 0;
}
}
/* /*
========================== ==========================
CG_GrappleTrail CG_GrappleTrail
@ -710,7 +715,6 @@ void CG_RegisterWeapon( int weaponNum ) {
MAKERGB( weaponInfo->flashDlightColor, 0.6, 0.6, 1 ); MAKERGB( weaponInfo->flashDlightColor, 0.6, 0.6, 1 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse );
cgs.media.flameExplosionShader = trap_R_RegisterShader( "rocketExplosion" ); cgs.media.flameExplosionShader = trap_R_RegisterShader( "rocketExplosion" );
break; break;
// Q3Rally Code END // Q3Rally Code END
@ -997,6 +1001,7 @@ static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) {
*/ */
// END // END
/* /*
=============== ===============
CG_LightningBolt CG_LightningBolt
@ -1023,7 +1028,7 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
//centity_t *traceEnt; //centity_t *traceEnt;
// END // END
if ( cent->currentState.weapon != WP_LIGHTNING ) { if (cent->currentState.weapon != WP_LIGHTNING) {
return; return;
} }
@ -1190,7 +1195,6 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
*/ */
/* /*
====================== ======================
CG_MachinegunSpinAngle CG_MachinegunSpinAngle
@ -1272,7 +1276,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
weapon_t weaponNum; weapon_t weaponNum;
weaponInfo_t *weapon; weaponInfo_t *weapon;
centity_t *nonPredictedCent; centity_t *nonPredictedCent;
// int col;
weaponNum = cent->currentState.weapon; weaponNum = cent->currentState.weapon;
@ -1446,6 +1449,7 @@ void CG_AddViewWeapon( playerState_t *ps ) {
return; return;
} }
// allow the gun to be completely removed // allow the gun to be completely removed
if ( !cg_drawGun.integer ) { if ( !cg_drawGun.integer ) {
vec3_t origin; vec3_t origin;
@ -1554,7 +1558,7 @@ void CG_DrawWeaponSelect( void ) {
bits = cg.snap->ps.stats[ STAT_WEAPONS ]; bits = cg.snap->ps.stats[ STAT_WEAPONS ];
count = 0; count = 0;
// Q3Rally Code Start // Q3Rally Code Start
// for ( i = 1 ; i < 16 ; i++ ) { // for ( i = 1 ; i < MAX_WEAPONS ; i++ ) {
for ( i = 1 ; i < RWP_SMOKE ; i++ ) { for ( i = 1 ; i < RWP_SMOKE ; i++ ) {
// END // END
if ( bits & ( 1 << i ) ) { if ( bits & ( 1 << i ) ) {
@ -1566,7 +1570,7 @@ void CG_DrawWeaponSelect( void ) {
y = 380; y = 380;
// Q3Rally Code Start // Q3Rally Code Start
// for ( i = 1 ; i < 16 ; i++ ) { // for ( i = 1 ; i < MAX_WEAPONS ; i++ ) {
for ( i = 1 ; i < RWP_SMOKE ; i++ ) { for ( i = 1 ; i < RWP_SMOKE ; i++ ) {
// END // END
if ( !( bits & ( 1 << i ) ) ) { if ( !( bits & ( 1 << i ) ) ) {
@ -1645,9 +1649,9 @@ void CG_NextWeapon_f( void ) {
cg.weaponSelectTime = cg.time; cg.weaponSelectTime = cg.time;
original = cg.weaponSelect; original = cg.weaponSelect;
for ( i = 0 ; i < 16 ; i++ ) { for ( i = 0 ; i < MAX_WEAPONS ; i++ ) {
cg.weaponSelect++; cg.weaponSelect++;
if ( cg.weaponSelect == 16 ) { if ( cg.weaponSelect == MAX_WEAPONS ) {
cg.weaponSelect = 0; cg.weaponSelect = 0;
} }
if ( cg.weaponSelect == WP_GAUNTLET ) { if ( cg.weaponSelect == WP_GAUNTLET ) {
@ -1657,7 +1661,7 @@ void CG_NextWeapon_f( void ) {
break; break;
} }
} }
if ( i == 16 ) { if ( i == MAX_WEAPONS ) {
cg.weaponSelect = original; cg.weaponSelect = original;
} }
} }
@ -1681,10 +1685,10 @@ void CG_PrevWeapon_f( void ) {
cg.weaponSelectTime = cg.time; cg.weaponSelectTime = cg.time;
original = cg.weaponSelect; original = cg.weaponSelect;
for ( i = 0 ; i < 16 ; i++ ) { for ( i = 0 ; i < MAX_WEAPONS ; i++ ) {
cg.weaponSelect--; cg.weaponSelect--;
if ( cg.weaponSelect == -1 ) { if ( cg.weaponSelect == -1 ) {
cg.weaponSelect = 15; cg.weaponSelect = MAX_WEAPONS - 1;
} }
if ( cg.weaponSelect == WP_GAUNTLET ) { if ( cg.weaponSelect == WP_GAUNTLET ) {
continue; // never cycle to gauntlet continue; // never cycle to gauntlet
@ -1693,7 +1697,7 @@ void CG_PrevWeapon_f( void ) {
break; break;
} }
} }
if ( i == 16 ) { if ( i == MAX_WEAPONS ) {
cg.weaponSelect = original; cg.weaponSelect = original;
} }
} }
@ -1716,7 +1720,7 @@ void CG_Weapon_f( void ) {
num = atoi( CG_Argv( 1 ) ); num = atoi( CG_Argv( 1 ) );
// Q3Rally Code Start // Q3Rally Code Start
// if ( num < 1 || num > 15 ) { // if ( num < 1 || num > MAX_WEAPONS-1 ) {
if ( num < 1 || num >= RWP_SMOKE ) { if ( num < 1 || num >= RWP_SMOKE ) {
// END // END
return; return;
@ -1743,7 +1747,7 @@ void CG_OutOfAmmoChange( void ) {
cg.weaponSelectTime = cg.time; cg.weaponSelectTime = cg.time;
for ( i = 15 ; i > 0 ; i-- ) { for ( i = MAX_WEAPONS-1 ; i > 0 ; i-- ) {
if ( CG_WeaponSelectable( i ) ) { if ( CG_WeaponSelectable( i ) ) {
cg.weaponSelect = i; cg.weaponSelect = i;
break; break;
@ -2027,6 +2031,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
radius = 16; radius = 16;
break; break;
// Q3Rally Code END // Q3Rally Code END
#ifdef MISSIONPACK #ifdef MISSIONPACK
case WP_CHAINGUN: case WP_CHAINGUN:
mod = cgs.media.bulletFlashModel; mod = cgs.media.bulletFlashModel;
@ -2154,28 +2159,23 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum ) {
sourceContentType = CG_PointContents( start, 0 ); sourceContentType = CG_PointContents( start, 0 );
destContentType = CG_PointContents( tr.endpos, 0 ); destContentType = CG_PointContents( tr.endpos, 0 );
// FIXME: should probably move this cruft into CG_BubbleTrail // FIXME: should probably move this cruft into CG_BubbleTrail
if ( sourceContentType == destContentType ) { if ( sourceContentType == destContentType ) {
if ( sourceContentType & CONTENTS_WATER ) { if ( sourceContentType & CONTENTS_WATER ) {
CG_BubbleTrail( start, tr.endpos, 32 ); CG_BubbleTrail( start, tr.endpos, 32 );
} }
} else if ( sourceContentType & CONTENTS_WATER ) { } else if ( sourceContentType & CONTENTS_WATER ) {
trace_t trace; trace_t trace;
trap_CM_BoxTrace( &trace, end, start, NULL, NULL, 0, CONTENTS_WATER ); trap_CM_BoxTrace( &trace, end, start, NULL, NULL, 0, CONTENTS_WATER );
CG_BubbleTrail( start, trace.endpos, 32 ); CG_BubbleTrail( start, trace.endpos, 32 );
} } else if ( destContentType & CONTENTS_WATER ) {
else if ( destContentType & CONTENTS_WATER ) {
trace_t trace; trace_t trace;
trap_CM_BoxTrace( &trace, start, end, NULL, NULL, 0, CONTENTS_WATER ); trap_CM_BoxTrace( &trace, start, end, NULL, NULL, 0, CONTENTS_WATER );
CG_BubbleTrail( tr.endpos, trace.endpos, 32 ); CG_BubbleTrail( tr.endpos, trace.endpos, 32 );
} }
if ( tr.surfaceFlags & SURF_NOIMPACT ) { if ( tr.surfaceFlags & SURF_NOIMPACT ) {
return; return;
} }
@ -2445,5 +2445,3 @@ void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal, qboolean flesh,
} }
} }