mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-23 20:21:32 +00:00
cgame bugfixes and warning cleanups
This commit is contained in:
parent
d31d70a910
commit
353079cebc
21 changed files with 158 additions and 151 deletions
|
@ -358,7 +358,7 @@ static void CG_SnowParticleRender(cg_atmosphericParticle_t * particle)
|
|||
vec3_t forward, right;
|
||||
polyVert_t verts[4];
|
||||
vec2_t line;
|
||||
float len, frac, sinTumbling, cosTumbling, particleWidth;
|
||||
float len, sinTumbling, cosTumbling, particleWidth;
|
||||
vec3_t start, finish;
|
||||
|
||||
if (!particle->active)
|
||||
|
@ -376,7 +376,7 @@ static void CG_SnowParticleRender(cg_atmosphericParticle_t * particle)
|
|||
if (start[2] <= particle->minz) {
|
||||
// Stop snow going through surfaces.
|
||||
len = particle->height - particle->minz + start[2];
|
||||
frac = start[2];
|
||||
// frac = start[2];
|
||||
VectorMA(start, len - particle->height, particle->deltaNormalized, start);
|
||||
}
|
||||
if (len <= 0)
|
||||
|
|
|
@ -1141,9 +1141,9 @@ static float CG_DrawTeamOverlay(float y, qboolean right, qboolean upper)
|
|||
p = CG_ConfigString(CS_LOCATIONS + ci->location);
|
||||
if (!p || !*p)
|
||||
p = "unknown";
|
||||
len = CG_DrawStrlen(p);
|
||||
if (len > lwidth)
|
||||
len = lwidth;
|
||||
//len = CG_DrawStrlen(p);
|
||||
//if (len > lwidth)
|
||||
// len = lwidth;
|
||||
|
||||
// xx = x + TINYCHAR_WIDTH * 2 + TINYCHAR_WIDTH * pwidth +
|
||||
// ((lwidth/2 - len/2) * TINYCHAR_WIDTH);
|
||||
|
@ -2118,7 +2118,8 @@ static void CG_ScanForCrosshairEntity(void)
|
|||
return;
|
||||
}
|
||||
// if the player is in fog, don't show it
|
||||
content = trap_CM_PointContents(trace.endpos, 0);
|
||||
//content = trap_CM_PointContents(trace.endpos, 0);
|
||||
content = CG_PointContents( trace.endpos, 0 );
|
||||
if (content & CONTENTS_FOG) {
|
||||
return;
|
||||
}
|
||||
|
@ -2337,9 +2338,9 @@ static void CG_DrawTeamVote(void)
|
|||
int sec, cs_offset, y = 100;
|
||||
float Color1[4];
|
||||
|
||||
if (cgs.clientinfo->team == TEAM_RED)
|
||||
if ( cgs.clientinfo[cg.clientNum].team == TEAM_RED )
|
||||
cs_offset = 0;
|
||||
else if (cgs.clientinfo->team == TEAM_BLUE)
|
||||
else if ( cgs.clientinfo[cg.clientNum].team == TEAM_BLUE )
|
||||
cs_offset = 1;
|
||||
else
|
||||
return;
|
||||
|
@ -2488,10 +2489,11 @@ static qboolean CG_DrawFollow(void)
|
|||
CG_DrawAmmoWarning
|
||||
=================
|
||||
*/
|
||||
/* JBravo: Not used
|
||||
static void CG_DrawAmmoWarning(void)
|
||||
{
|
||||
const char *s;
|
||||
int w;
|
||||
// int w;
|
||||
|
||||
if (cg_drawAmmoWarning.integer == 0) {
|
||||
return;
|
||||
|
@ -2506,10 +2508,11 @@ static void CG_DrawAmmoWarning(void)
|
|||
} else {
|
||||
s = "LOW AMMO WARNING";
|
||||
}
|
||||
w = CG_DrawStrlen(s) * BIGCHAR_WIDTH;
|
||||
CG_DrawStrlen(s) * BIGCHAR_WIDTH;
|
||||
//Elder: commented out for now
|
||||
//CG_DrawBigString(320 - w / 2, 64, s, 1.0F);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -2521,7 +2524,7 @@ static void CG_DrawWarmup(void)
|
|||
int w;
|
||||
int sec;
|
||||
int i;
|
||||
float scale;
|
||||
// float scale;
|
||||
clientInfo_t *ci1, *ci2;
|
||||
int cw;
|
||||
const char *s;
|
||||
|
@ -2611,23 +2614,23 @@ static void CG_DrawWarmup(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
scale = 0.45f;
|
||||
// scale = 0.45f;
|
||||
switch (cg.warmupCount) {
|
||||
case 0:
|
||||
cw = 28;
|
||||
scale = 0.54f;
|
||||
// scale = 0.54f;
|
||||
break;
|
||||
case 1:
|
||||
cw = 24;
|
||||
scale = 0.51f;
|
||||
// scale = 0.51f;
|
||||
break;
|
||||
case 2:
|
||||
cw = 20;
|
||||
scale = 0.48f;
|
||||
// scale = 0.48f;
|
||||
break;
|
||||
default:
|
||||
cw = 16;
|
||||
scale = 0.45f;
|
||||
// scale = 0.45f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2679,7 +2682,7 @@ static void CG_Draw2D(void)
|
|||
if (cg.snap->ps.stats[STAT_HEALTH] > 0) {
|
||||
CG_DrawCrosshair();
|
||||
CG_DrawStatusBar();
|
||||
CG_DrawAmmoWarning();
|
||||
// CG_DrawAmmoWarning();
|
||||
CG_DrawCrosshairNames();
|
||||
CG_DrawWeaponSelect();
|
||||
CG_DrawHoldableItem();
|
||||
|
|
|
@ -587,10 +587,6 @@ void CG_ColorForHealth(vec4_t hcolor)
|
|||
CG_GetColorForHealth(cg.snap->ps.stats[STAT_HEALTH], cg.snap->ps.stats[STAT_ARMOR], 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
|
||||
|
@ -989,7 +985,7 @@ static void UI_DrawBannerString2(int x, int y, const char *str, vec4_t color)
|
|||
trap_R_SetColor(color);
|
||||
|
||||
ax = x * cgs.screenXScale + cgs.screenXBias;
|
||||
ay = y * cgs.screenXScale;
|
||||
ay = y * cgs.screenYScale;
|
||||
|
||||
s = str;
|
||||
while (*s) {
|
||||
|
@ -1003,7 +999,7 @@ static void UI_DrawBannerString2(int x, int y, const char *str, vec4_t color)
|
|||
fwidth = (float) propMapB[ch][2] / 256.0f;
|
||||
fheight = (float) PROPB_HEIGHT / 256.0f;
|
||||
aw = (float) propMapB[ch][2] * cgs.screenXScale;
|
||||
ah = (float) PROPB_HEIGHT *cgs.screenXScale;
|
||||
ah = (float) PROPB_HEIGHT *cgs.screenYScale;
|
||||
|
||||
trap_R_DrawStretchPic(ax, ay, aw, ah, fcol, frow, fcol + fwidth, frow + fheight,
|
||||
cgs.media.charsetPropB);
|
||||
|
@ -1205,4 +1201,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);
|
||||
}
|
||||
#endif // Q3STATIC
|
||||
|
|
|
@ -1036,7 +1036,7 @@ void CG_BreakBreakable(centity_t * cent, int eParam, int number)
|
|||
qhandle_t mod;
|
||||
qhandle_t shader;
|
||||
vec3_t shrapnelDest;
|
||||
localEntity_t *smokePuff;
|
||||
// localEntity_t *smokePuff;
|
||||
vec3_t puffDir;
|
||||
|
||||
float light;
|
||||
|
@ -1049,13 +1049,14 @@ void CG_BreakBreakable(centity_t * cent, int eParam, int number)
|
|||
// JBravo: Unused variable
|
||||
// int modelbias[10] = { 0, 0, 0, 0, 1, 1, 1, 2, 2 };
|
||||
int id;
|
||||
int count;
|
||||
// int count;
|
||||
|
||||
id = (eParam & 63);
|
||||
eParam = eParam >> 6;
|
||||
|
||||
trap_S_StartSound(NULL, number, CHAN_BODY, cgs.media.breakables[id].exp_sound);
|
||||
|
||||
/* JBravo: After all that setting of 'count' it is never used.
|
||||
if ((eParam & RQ3_DEBRIS_MEDIUM) == RQ3_DEBRIS_MEDIUM && (eParam & RQ3_DEBRIS_HIGH) == RQ3_DEBRIS_HIGH) {
|
||||
//Tons
|
||||
count = 65 + rand() % 16;
|
||||
|
@ -1069,6 +1070,7 @@ void CG_BreakBreakable(centity_t * cent, int eParam, int number)
|
|||
//Small
|
||||
count = 8 + rand() % 6;
|
||||
}
|
||||
*/
|
||||
//if (material) material--;
|
||||
VectorCopy(cent->lerpOrigin, origin);
|
||||
/*
|
||||
|
@ -1115,7 +1117,7 @@ void CG_BreakBreakable(centity_t * cent, int eParam, int number)
|
|||
puffDir[1] = 0;
|
||||
puffDir[2] = 20;
|
||||
origin[2] -= 16;
|
||||
smokePuff = CG_SmokePuff(origin, puffDir,
|
||||
CG_SmokePuff(origin, puffDir,
|
||||
rand() % 12 + 100, 1, 1, 1, 0.6f, 3000, cg.time, 0, 0, cgs.media.smokePuffShader);
|
||||
|
||||
}
|
||||
|
@ -1123,10 +1125,10 @@ void CG_BreakBreakable(centity_t * cent, int eParam, int number)
|
|||
void CG_Pressure(vec3_t origin, vec3_t dir, int type, int speed, int life)
|
||||
{
|
||||
localEntity_t *le;
|
||||
refEntity_t *re;
|
||||
// refEntity_t *re;
|
||||
|
||||
le = CG_AllocLocalEntity();
|
||||
re = &le->refEntity;
|
||||
// re = &le->refEntity;
|
||||
le->leType = LE_PRESSURE;
|
||||
|
||||
if (type == 1)
|
||||
|
|
|
@ -344,14 +344,13 @@ static void CG_EntityEffects(centity_t * cent)
|
|||
// constant light glow
|
||||
if (cent->currentState.constantLight && cent->currentState.eType != ET_DLIGHT) {
|
||||
int cl;
|
||||
int i, r, g, b;
|
||||
float i, r, g, b;
|
||||
|
||||
cl = cent->currentState.constantLight;
|
||||
r = cl & 255;
|
||||
g = (cl >> 8) & 255;
|
||||
b = (cl >> 16) & 255;
|
||||
i = ((cl >> 24) & 255) * 4;
|
||||
|
||||
r = (float) (cl & 0xFF) / 255.0;
|
||||
g = (float) ((cl >> 8) & 0xFF) / 255.0;
|
||||
b = (float) ((cl >> 16) & 0xFF) / 255.0;
|
||||
i = (float) ((cl >> 24) & 0xFF) * 4.0;
|
||||
trap_R_AddLightToScene(cent->lerpOrigin, i, r, g, b);
|
||||
}
|
||||
|
||||
|
@ -702,7 +701,7 @@ static void CG_Missile(centity_t * cent)
|
|||
const weaponInfo_t *weapon;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
if (s1->weapon > WP_NUM_WEAPONS) {
|
||||
if (s1->weapon >= WP_NUM_WEAPONS) {
|
||||
s1->weapon = 0;
|
||||
}
|
||||
weapon = &cg_weapons[s1->weapon];
|
||||
|
@ -782,7 +781,7 @@ static void CG_Grapple(centity_t * cent)
|
|||
const weaponInfo_t *weapon;
|
||||
|
||||
s1 = ¢->currentState;
|
||||
if (s1->weapon > WP_NUM_WEAPONS) {
|
||||
if (s1->weapon >= WP_NUM_WEAPONS) {
|
||||
s1->weapon = 0;
|
||||
}
|
||||
weapon = &cg_weapons[s1->weapon];
|
||||
|
@ -967,7 +966,7 @@ void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int
|
|||
CG_EvaluateTrajectoryEx(cent, toTime, origin, angles);
|
||||
|
||||
VectorSubtract(origin, oldOrigin, deltaOrigin);
|
||||
VectorSubtract(angles, oldAngles, deltaAngles);
|
||||
//VectorSubtract(angles, oldAngles, deltaAngles);
|
||||
|
||||
VectorAdd(in, deltaOrigin, out);
|
||||
|
||||
|
@ -1134,7 +1133,8 @@ static void CG_DrawDecal(centity_t * cent)
|
|||
{
|
||||
trace_t trace;
|
||||
vec3_t end;
|
||||
float alpha, radius;
|
||||
//float alpha, radius;
|
||||
float radius;
|
||||
|
||||
if (cgs.gametype == GT_CTF) {
|
||||
//cent->currentState.modelindex
|
||||
|
@ -1142,7 +1142,7 @@ static void CG_DrawDecal(centity_t * cent)
|
|||
VectorCopy(cent->lerpOrigin, end);
|
||||
end[2] -= 8192;
|
||||
|
||||
alpha = sin(cg.time / 160.0f) * 0.25 + 0.75f;
|
||||
// alpha = sin(cg.time / 160.0f) * 0.25 + 0.75f;
|
||||
radius = 48 + (cos(cg.time / 320.0f) * 4.0f);
|
||||
|
||||
// Project downward to the ground
|
||||
|
|
|
@ -741,10 +741,9 @@ void CG_EntityEvent(centity_t * cent, vec3_t position)
|
|||
DEBUGNAME("EV_JUMP_PAD");
|
||||
// CG_Printf( "EV_JUMP_PAD w/effect #%i\n", es->eventParm );
|
||||
{
|
||||
localEntity_t *smoke;
|
||||
vec3_t up = { 0, 0, 1 };
|
||||
|
||||
smoke = CG_SmokePuff(cent->lerpOrigin, up,
|
||||
CG_SmokePuff(cent->lerpOrigin, up,
|
||||
32,
|
||||
1, 1, 1, 0.33f,
|
||||
1000, cg.time, 0, LEF_PUFF_DONT_SCALE, cgs.media.smokePuffShader);
|
||||
|
|
|
@ -404,7 +404,8 @@
|
|||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "../qcommon/q_shared.h"
|
||||
#include "tr_types.h"
|
||||
#include "../renderer/tr_types.h"
|
||||
#include "../renderergl2/tr_extratypes.h"
|
||||
#include "../game/bg_public.h"
|
||||
#include "cg_public.h"
|
||||
|
||||
|
@ -587,7 +588,7 @@ typedef struct {
|
|||
int lightningFiring;
|
||||
|
||||
// railgun trail spawning
|
||||
vec3_t railgunImpact;
|
||||
// vec3_t railgunImpact;
|
||||
qboolean railgunFlash;
|
||||
|
||||
// machinegun spinning
|
||||
|
@ -885,7 +886,7 @@ typedef struct weaponInfo_s {
|
|||
sfxWeapTiming_t animationSounds[MAX_ANIM_SOUNDS];
|
||||
sfxHandle_t worldReloadSound[3];
|
||||
|
||||
qboolean loopFireSound;
|
||||
// qboolean loopFireSound;
|
||||
} weaponInfo_t;
|
||||
|
||||
// each IT_* item has an associated itemInfo_t
|
||||
|
|
|
@ -345,7 +345,7 @@ void CG_AddFragment(localEntity_t * le)
|
|||
// if it is in a nodrop zone, remove it
|
||||
// this keeps gibs from waiting at the bottom of pits of death
|
||||
// and floating levels
|
||||
if (trap_CM_PointContents(trace.endpos, 0) & CONTENTS_NODROP) {
|
||||
if ( CG_PointContents( trace.endpos, 0 ) & CONTENTS_NODROP ) {
|
||||
CG_FreeLocalEntity(le);
|
||||
return;
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ void CG_AddScorePlum(localEntity_t * le)
|
|||
void CG_AddPressureEntity(localEntity_t * le)
|
||||
{
|
||||
vec3_t velocity;
|
||||
vec3_t origin;
|
||||
// vec3_t origin;
|
||||
float alpha;
|
||||
|
||||
// Kill it if LCA.
|
||||
|
@ -692,7 +692,7 @@ void CG_AddPressureEntity(localEntity_t * le)
|
|||
} else
|
||||
VectorScale(le->pos.trDelta, le->size, velocity);
|
||||
|
||||
VectorCopy(le->pos.trBase, origin);
|
||||
// VectorCopy(le->pos.trBase, origin);
|
||||
|
||||
if (le->leFlags == LEF_AIR)
|
||||
CG_ParticleAir(le->pos.trBase, velocity, le->life + rand() % 120, alpha, 2, 1);
|
||||
|
|
|
@ -1313,9 +1313,6 @@ void QDECL CG_Error(const char *msg, ...)
|
|||
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, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
@ -1340,8 +1337,6 @@ void QDECL Com_Printf(const char *msg, ...)
|
|||
CG_Printf("%s", text);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
================
|
||||
CG_Argv
|
||||
|
@ -2470,7 +2465,7 @@ CG_BuildSpectatorString
|
|||
|
||||
=======================
|
||||
*/
|
||||
void CG_BuildSpectatorString()
|
||||
void CG_BuildSpectatorString(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -1090,9 +1090,9 @@ void CG_AddParticles(void)
|
|||
float alpha;
|
||||
float time, time2, mtime, mtime2;
|
||||
vec3_t org;
|
||||
int color;
|
||||
// int color;
|
||||
cparticle_t *active, *tail;
|
||||
int type;
|
||||
// int type;
|
||||
vec3_t rotate_ang;
|
||||
trace_t tr;
|
||||
vec3_t dist, end;
|
||||
|
@ -1190,7 +1190,7 @@ void CG_AddParticles(void)
|
|||
if (alpha > 1.0)
|
||||
alpha = 1;
|
||||
|
||||
color = p->color;
|
||||
// color = p->color;
|
||||
|
||||
time2 = time * time;
|
||||
mtime2 = mtime * mtime;
|
||||
|
@ -1206,7 +1206,7 @@ void CG_AddParticles(void)
|
|||
org[2] = p->org[2] + p->vel[2] * time + p->accel[2] * time2;
|
||||
}
|
||||
|
||||
type = p->type;
|
||||
// type = p->type;
|
||||
|
||||
CG_AddParticleToScene(p, org, alpha);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ int drawTeamOverlayModificationCount = -1;
|
|||
//static char teamChat1[256];
|
||||
//static char teamChat2[256];
|
||||
|
||||
void CG_InitTeamChat()
|
||||
void CG_InitTeamChat(void)
|
||||
{
|
||||
memset(teamChat1, 0, sizeof(teamChat1));
|
||||
memset(teamChat2, 0, sizeof(teamChat2));
|
||||
|
@ -59,7 +59,7 @@ void CG_SetPrintString(int type, const char *p)
|
|||
}
|
||||
}
|
||||
|
||||
void CG_CheckOrderPending()
|
||||
void CG_CheckOrderPending(void)
|
||||
{
|
||||
if (cgs.gametype < GT_CTF) {
|
||||
return;
|
||||
|
@ -127,7 +127,7 @@ void CG_CheckOrderPending()
|
|||
}
|
||||
}
|
||||
|
||||
static void CG_SetSelectedPlayerName()
|
||||
static void CG_SetSelectedPlayerName(void)
|
||||
{
|
||||
if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) {
|
||||
clientInfo_t *ci = cgs.clientinfo + sortedTeamPlayers[cg_currentSelectedPlayer.integer];
|
||||
|
@ -142,7 +142,7 @@ static void CG_SetSelectedPlayerName()
|
|||
trap_Cvar_Set("cg_selectedPlayerName", "Everyone");
|
||||
}
|
||||
}
|
||||
int CG_GetSelectedPlayer()
|
||||
int CG_GetSelectedPlayer(void)
|
||||
{
|
||||
if (cg_currentSelectedPlayer.integer < 0 || cg_currentSelectedPlayer.integer >= numSortedTeamPlayers) {
|
||||
cg_currentSelectedPlayer.integer = 0;
|
||||
|
@ -150,7 +150,7 @@ int CG_GetSelectedPlayer()
|
|||
return cg_currentSelectedPlayer.integer;
|
||||
}
|
||||
|
||||
void CG_SelectNextPlayer()
|
||||
void CG_SelectNextPlayer(void)
|
||||
{
|
||||
CG_CheckOrderPending();
|
||||
if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) {
|
||||
|
@ -161,7 +161,7 @@ void CG_SelectNextPlayer()
|
|||
CG_SetSelectedPlayerName();
|
||||
}
|
||||
|
||||
void CG_SelectPrevPlayer()
|
||||
void CG_SelectPrevPlayer(void)
|
||||
{
|
||||
CG_CheckOrderPending();
|
||||
if (cg_currentSelectedPlayer.integer > 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) {
|
||||
|
@ -174,8 +174,8 @@ void CG_SelectPrevPlayer()
|
|||
|
||||
static void CG_DrawPlayerArmorIcon(rectDef_t * rect, qboolean draw2D)
|
||||
{
|
||||
centity_t *cent;
|
||||
playerState_t *ps;
|
||||
// centity_t *cent;
|
||||
// playerState_t *ps;
|
||||
vec3_t angles;
|
||||
vec3_t origin;
|
||||
|
||||
|
@ -183,8 +183,8 @@ static void CG_DrawPlayerArmorIcon(rectDef_t * rect, qboolean draw2D)
|
|||
return;
|
||||
}
|
||||
|
||||
cent = &cg_entities[cg.snap->ps.clientNum];
|
||||
ps = &cg.snap->ps;
|
||||
// cent = &cg_entities[cg.snap->ps.clientNum];
|
||||
// ps = &cg.snap->ps;
|
||||
|
||||
if (draw2D || (!cg_draw3dIcons.integer && cg_drawIcons.integer)) { // bk001206 - parentheses
|
||||
CG_DrawPic(rect->x, rect->y + rect->h / 2 + 1, rect->w, rect->h, cgs.media.armorIcon);
|
||||
|
@ -193,7 +193,7 @@ static void CG_DrawPlayerArmorIcon(rectDef_t * rect, qboolean draw2D)
|
|||
origin[0] = 90;
|
||||
origin[1] = 0;
|
||||
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);
|
||||
}
|
||||
|
@ -204,10 +204,10 @@ static void CG_DrawPlayerArmorValue(rectDef_t * rect, float scale, vec4_t color,
|
|||
{
|
||||
char num[16];
|
||||
int value;
|
||||
centity_t *cent;
|
||||
// centity_t *cent;
|
||||
playerState_t *ps;
|
||||
|
||||
cent = &cg_entities[cg.snap->ps.clientNum];
|
||||
// cent = &cg_entities[cg.snap->ps.clientNum];
|
||||
ps = &cg.snap->ps;
|
||||
|
||||
value = ps->stats[STAT_ARMOR];
|
||||
|
@ -237,12 +237,12 @@ static float healthColors[4][4] = {
|
|||
static void CG_DrawPlayerAmmoIcon(rectDef_t * rect, qboolean draw2D)
|
||||
{
|
||||
centity_t *cent;
|
||||
playerState_t *ps;
|
||||
// playerState_t *ps;
|
||||
vec3_t angles;
|
||||
vec3_t origin;
|
||||
|
||||
cent = &cg_entities[cg.snap->ps.clientNum];
|
||||
ps = &cg.snap->ps;
|
||||
// ps = &cg.snap->ps;
|
||||
|
||||
if (draw2D || (!cg_draw3dIcons.integer && cg_drawIcons.integer)) { // bk001206 - parentheses
|
||||
qhandle_t icon;
|
||||
|
@ -390,7 +390,7 @@ static void CG_DrawSelectedPlayerArmor(rectDef_t * rect, float scale, vec4_t col
|
|||
|
||||
qhandle_t CG_StatusHandle(int task)
|
||||
{
|
||||
qhandle_t h = cgs.media.assaultShader;
|
||||
qhandle_t h;
|
||||
|
||||
switch (task) {
|
||||
case TEAMTASK_OFFENSE:
|
||||
|
@ -1020,7 +1020,7 @@ float CG_GetValue(int ownerDraw)
|
|||
return -1;
|
||||
}
|
||||
|
||||
qboolean CG_OtherTeamHasFlag()
|
||||
qboolean CG_OtherTeamHasFlag(void)
|
||||
{
|
||||
if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) {
|
||||
int team = cg.snap->ps.persistant[PERS_TEAM];
|
||||
|
@ -1046,7 +1046,7 @@ qboolean CG_OtherTeamHasFlag()
|
|||
return qfalse;
|
||||
}
|
||||
|
||||
qboolean CG_YourTeamHasFlag()
|
||||
qboolean CG_YourTeamHasFlag(void)
|
||||
{
|
||||
if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) {
|
||||
int team = cg.snap->ps.persistant[PERS_TEAM];
|
||||
|
@ -1210,7 +1210,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);
|
||||
}
|
||||
|
||||
const char *CG_GetKillerText()
|
||||
const char *CG_GetKillerText(void)
|
||||
{
|
||||
const char *s = "";
|
||||
|
||||
|
@ -1253,7 +1253,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 = "";
|
||||
|
||||
|
@ -1279,7 +1279,7 @@ static void CG_DrawGameStatus(rectDef_t * rect, float scale, vec4_t color, qhand
|
|||
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) {
|
||||
return "Free For All";
|
||||
|
@ -1842,7 +1842,7 @@ CG_HideTeamMenus
|
|||
==================
|
||||
|
||||
*/
|
||||
void CG_HideTeamMenu()
|
||||
void CG_HideTeamMenu(void)
|
||||
{
|
||||
Menus_CloseByName("teamMenu");
|
||||
Menus_CloseByName("getMenu");
|
||||
|
@ -1854,7 +1854,7 @@ CG_ShowTeamMenus
|
|||
==================
|
||||
|
||||
*/
|
||||
void CG_ShowTeamMenu()
|
||||
void CG_ShowTeamMenu(void)
|
||||
{
|
||||
Menus_OpenByName("teamMenu");
|
||||
}
|
||||
|
@ -1922,7 +1922,7 @@ int CG_ClientNumFromName(const char *p)
|
|||
return -1;
|
||||
}
|
||||
|
||||
void CG_ShowResponseHead()
|
||||
void CG_ShowResponseHead(void)
|
||||
{
|
||||
Menus_OpenByName("voiceMenu");
|
||||
trap_Cvar_Set("cl_conXOffset", "72");
|
||||
|
|
|
@ -784,9 +784,9 @@ void CG_AddParticles(void)
|
|||
float alpha;
|
||||
float time, time2;
|
||||
vec3_t org;
|
||||
int color;
|
||||
// int color;
|
||||
cparticle_t *active, *tail;
|
||||
int type;
|
||||
// int type;
|
||||
vec3_t rotate_ang;
|
||||
|
||||
if (!initparticles)
|
||||
|
@ -881,7 +881,7 @@ void CG_AddParticles(void)
|
|||
if (alpha > 1.0)
|
||||
alpha = 1;
|
||||
|
||||
color = p->color;
|
||||
// color = p->color;
|
||||
|
||||
time2 = time * time;
|
||||
|
||||
|
@ -889,7 +889,7 @@ void CG_AddParticles(void)
|
|||
org[1] = p->org[1] + p->vel[1] * time + p->accel[1] * time2;
|
||||
org[2] = p->org[2] + p->vel[2] * time + p->accel[2] * time2;
|
||||
|
||||
type = p->type;
|
||||
// type = p->type;
|
||||
|
||||
CG_AddParticleToScene(p, org, alpha);
|
||||
}
|
||||
|
@ -1567,8 +1567,8 @@ qboolean ValidBloodPool(vec3_t start)
|
|||
vec3_t angles;
|
||||
vec3_t right, up;
|
||||
vec3_t this_pos, x_pos, center_pos, end_pos;
|
||||
float x, y;
|
||||
float fwidth, fheight;
|
||||
int x, y;
|
||||
int fwidth, fheight;
|
||||
trace_t trace;
|
||||
vec3_t normal;
|
||||
|
||||
|
|
|
@ -255,6 +255,7 @@ static qboolean CG_ParseAnimationFile(const char *filename, clientInfo_t * ci)
|
|||
}
|
||||
if (len >= sizeof(text) - 1) {
|
||||
CG_Printf("^1File %s too long\n", filename);
|
||||
trap_FS_FCloseFile(f);
|
||||
return qfalse;
|
||||
}
|
||||
trap_FS_Read(text, len, f);
|
||||
|
@ -398,7 +399,7 @@ static qboolean CG_ParseAnimationFile(const char *filename, clientInfo_t * ci)
|
|||
}
|
||||
|
||||
if (i != MAX_ANIMATIONS) {
|
||||
CG_Printf("^1Error parsing animation file: %s", filename);
|
||||
CG_Printf("^1Error parsing animation file: %s\n", filename);
|
||||
return qfalse;
|
||||
}
|
||||
// crouch backward animation
|
||||
|
@ -449,7 +450,7 @@ static qboolean CG_FileExists(const char *filename)
|
|||
{
|
||||
int len;
|
||||
|
||||
len = trap_FS_FOpenFile(filename, 0, FS_READ);
|
||||
len = trap_FS_FOpenFile(filename, NULL, FS_READ);
|
||||
if (len > 0) {
|
||||
return qtrue;
|
||||
}
|
||||
|
@ -816,12 +817,11 @@ Load it now, taking the disk hits.
|
|||
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;
|
||||
int i, modelloaded;
|
||||
const char *s;
|
||||
int clientNum;
|
||||
char teamname[MAX_QPATH];
|
||||
|
||||
teamname[0] = 0;
|
||||
|
@ -892,7 +892,7 @@ static void CG_LoadClientInfo(clientInfo_t * ci)
|
|||
|
||||
// reset any existing players and bodies, because they might be in bad
|
||||
// frames for this new model
|
||||
clientNum = ci - cgs.clientinfo;
|
||||
// clientNum = ci - cgs.clientinfo;
|
||||
for (i = 0; i < MAX_GENTITIES; i++) {
|
||||
if (cg_entities[i].currentState.clientNum == clientNum
|
||||
&& cg_entities[i].currentState.eType == ET_PLAYER) {
|
||||
|
@ -973,7 +973,7 @@ We aren't going to load it now, so grab some other
|
|||
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;
|
||||
clientInfo_t *match;
|
||||
|
@ -992,7 +992,7 @@ static void CG_SetDeferredClientInfo(clientInfo_t * ci)
|
|||
continue;
|
||||
}
|
||||
// just load the real info cause it uses the same models and skins
|
||||
CG_LoadClientInfo(ci);
|
||||
CG_LoadClientInfo(clientNum, ci);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ static void CG_SetDeferredClientInfo(clientInfo_t * ci)
|
|||
// an improper team skin. This will cause a hitch for the first
|
||||
// player, when the second enters. Combat shouldn't be going on
|
||||
// yet, so it shouldn't matter
|
||||
CG_LoadClientInfo(ci);
|
||||
CG_LoadClientInfo(clientNum, ci);
|
||||
return;
|
||||
}
|
||||
// find the first valid clientinfo and grab its stuff
|
||||
|
@ -1033,7 +1033,7 @@ static void CG_SetDeferredClientInfo(clientInfo_t * ci)
|
|||
// we should never get here...
|
||||
CG_Printf("^1CG_SetDeferredClientInfo: no valid clients!\n");
|
||||
|
||||
CG_LoadClientInfo(ci);
|
||||
CG_LoadClientInfo(clientNum, ci);
|
||||
}
|
||||
|
||||
/* CG_UpdateTeamVars() by Slicer
|
||||
|
@ -1257,14 +1257,14 @@ void CG_NewClientInfo(int clientNum)
|
|||
// if we are defering loads, just have it pick the first valid
|
||||
if (forceDefer || (cg_deferPlayers.integer && !cg_buildScript.integer && !cg.loading)) {
|
||||
// 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 (forceDefer) {
|
||||
CG_Printf("^1Memory is low. Using deferred model.\n");
|
||||
newInfo.deferred = qfalse;
|
||||
}
|
||||
} else {
|
||||
CG_LoadClientInfo(&newInfo);
|
||||
CG_LoadClientInfo(clientNum, &newInfo);
|
||||
}
|
||||
}
|
||||
// replace whatever was there with the new one
|
||||
|
@ -1296,7 +1296,7 @@ void CG_LoadDeferredPlayers(void)
|
|||
ci->deferred = qfalse;
|
||||
continue;
|
||||
}
|
||||
CG_LoadClientInfo(ci);
|
||||
CG_LoadClientInfo(i, ci);
|
||||
// break;
|
||||
}
|
||||
}
|
||||
|
@ -1748,7 +1748,8 @@ static void CG_PlayerAngles(centity_t * cent, vec3_t legs[3], vec3_t torso[3], v
|
|||
|
||||
// allow yaw to drift a bit
|
||||
if ((cent->currentState.legsAnim & ~ANIM_TOGGLEBIT) != LEGS_IDLE
|
||||
|| (cent->currentState.torsoAnim & ~ANIM_TOGGLEBIT) != TORSO_STAND) {
|
||||
|| ((cent->currentState.torsoAnim & ~ANIM_TOGGLEBIT) != TORSO_STAND
|
||||
&& (cent->currentState.torsoAnim & ~ANIM_TOGGLEBIT) != TORSO_STAND2)) {
|
||||
// if not standing still, always point all in the same direction
|
||||
cent->pe.torso.yawing = qtrue; // always center
|
||||
cent->pe.torso.pitching = qtrue; // always center
|
||||
|
@ -1918,7 +1919,8 @@ static void CG_BreathPuffs(centity_t * cent, refEntity_t * head)
|
|||
if (cent->currentState.eFlags & EF_DEAD) {
|
||||
return;
|
||||
}
|
||||
contents = trap_CM_PointContents(head->origin, 0);
|
||||
//contents = trap_CM_PointContents(head->origin, 0);
|
||||
contents = CG_PointContents( head->origin, 0 );
|
||||
if (contents & (CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1961,7 +1963,6 @@ CG_DustTrail
|
|||
static void CG_DustTrail(centity_t * cent)
|
||||
{
|
||||
int anim;
|
||||
localEntity_t *dust;
|
||||
vec3_t end, vel;
|
||||
trace_t tr;
|
||||
//Makro - added
|
||||
|
@ -2001,7 +2002,7 @@ static void CG_DustTrail(centity_t * cent)
|
|||
end[2] -= 16;
|
||||
|
||||
VectorSet(vel, 0, 0, -30);
|
||||
dust = CG_SmokePuff(end, vel, 24, color[0], color[1], color[2], color[3], 500, cg.time, 0, 0, cgs.media.dustPuffShader);
|
||||
CG_SmokePuff(end, vel, 24, color[0], color[1], color[2], color[3], 500, cg.time, 0, 0, cgs.media.dustPuffShader);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2325,7 +2326,8 @@ static void CG_PlayerSplash(centity_t * cent)
|
|||
|
||||
// if the feet aren't in liquid, don't make a mark
|
||||
// this won't handle moving water brushes, but they wouldn't draw right anyway...
|
||||
contents = trap_CM_PointContents(end, 0);
|
||||
//contents = trap_CM_PointContents(end, 0);
|
||||
contents = CG_PointContents( end, 0 );
|
||||
if (!(contents & (CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA))) {
|
||||
return;
|
||||
}
|
||||
|
@ -2334,7 +2336,8 @@ static void CG_PlayerSplash(centity_t * cent)
|
|||
start[2] += 32;
|
||||
|
||||
// if the head isn't out of liquid, don't make a mark
|
||||
contents = trap_CM_PointContents(start, 0);
|
||||
//contents = trap_CM_PointContents(start, 0);
|
||||
contents = CG_PointContents( start, 0 );
|
||||
if (contents & (CONTENTS_SOLID | CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ void CG_CheckAmmo(void)
|
|||
{
|
||||
//int i;
|
||||
int total;
|
||||
int previous;
|
||||
// int previous;
|
||||
|
||||
//int weapons;
|
||||
|
||||
|
@ -148,7 +148,7 @@ void CG_CheckAmmo(void)
|
|||
return;
|
||||
}
|
||||
|
||||
previous = cg.lowAmmoWarning;
|
||||
// previous = cg.lowAmmoWarning;
|
||||
|
||||
if (total == 0) {
|
||||
cg.lowAmmoWarning = 2;
|
||||
|
@ -405,7 +405,8 @@ CG_CheckLocalSounds
|
|||
*/
|
||||
void CG_CheckLocalSounds(playerState_t * ps, playerState_t * ops)
|
||||
{
|
||||
int health, armor, reward;
|
||||
//int health, armor, reward;
|
||||
int reward;
|
||||
|
||||
// don't play the sounds if the player just changed teams
|
||||
if (ps->persistant[PERS_TEAM] != ops->persistant[PERS_TEAM]) {
|
||||
|
@ -413,8 +414,8 @@ void CG_CheckLocalSounds(playerState_t * ps, playerState_t * ops)
|
|||
}
|
||||
// hit changes
|
||||
if (ps->persistant[PERS_HITS] > ops->persistant[PERS_HITS]) {
|
||||
armor = ps->persistant[PERS_ATTACKEE_ARMOR] & 0xff;
|
||||
health = ps->persistant[PERS_ATTACKEE_ARMOR] >> 8;
|
||||
// armor = ps->persistant[PERS_ATTACKEE_ARMOR] & 0xff;
|
||||
// health = ps->persistant[PERS_ATTACKEE_ARMOR] >> 8;
|
||||
} else if (ps->persistant[PERS_HITS] < ops->persistant[PERS_HITS]) {
|
||||
if (cg_RQ3_anouncer.integer == 1)
|
||||
trap_S_StartLocalSound(cgs.media.hitTeamSound, CHAN_LOCAL_SOUND);
|
||||
|
@ -451,7 +452,7 @@ void CG_CheckLocalSounds(playerState_t * ps, playerState_t * ops)
|
|||
reward = qtrue;
|
||||
}
|
||||
// check for flag pickup
|
||||
if (cgs.gametype >= GT_TEAM) {
|
||||
if (cgs.gametype > GT_TEAMPLAY) {
|
||||
if ((ps->powerups[PW_REDFLAG] != ops->powerups[PW_REDFLAG] && ps->powerups[PW_REDFLAG]) ||
|
||||
(ps->powerups[PW_BLUEFLAG] != ops->powerups[PW_BLUEFLAG] && ps->powerups[PW_BLUEFLAG]) ||
|
||||
(ps->powerups[PW_NEUTRALFLAG] != ops->powerups[PW_NEUTRALFLAG] && ps->powerups[PW_NEUTRALFLAG])) {
|
||||
|
@ -480,10 +481,13 @@ void CG_CheckLocalSounds(playerState_t * ps, playerState_t * ops)
|
|||
}
|
||||
}
|
||||
// timelimit warnings
|
||||
// JBravo: this does nothing
|
||||
/*
|
||||
if (cgs.timelimit > 0) {
|
||||
int msec;
|
||||
msec = cg.time - cgs.levelStartTime;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -241,7 +241,8 @@ int CG_PointContents(const vec3_t point, int passEntityNum)
|
|||
continue;
|
||||
}
|
||||
|
||||
contents |= trap_CM_TransformedPointContents(point, cmodel, ent->origin, ent->angles);
|
||||
//contents |= trap_CM_TransformedPointContents(point, cmodel, ent->origin, ent->angles);
|
||||
contents |= trap_CM_TransformedPointContents( point, cmodel, cent->lerpOrigin, cent->lerpAngles );
|
||||
}
|
||||
|
||||
return contents;
|
||||
|
|
|
@ -467,13 +467,13 @@ static int CG_TeamplayScoreboard(void)
|
|||
|
||||
// NiceAss: Deathmatch scoreboard:
|
||||
if (cg.scoreTPMode == 1 || cgs.gametype < GT_TEAM) {
|
||||
vec3_t headAngles;
|
||||
// vec3_t headAngles;
|
||||
DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, BlackL, colorWhite);
|
||||
DrawLeftStripText(y, SB_FONTSIZEH, "Frags Name", 100, colorWhite);
|
||||
DrawRightStripText(y, SB_FONTSIZEH, "Time Ping Damage", 100, colorWhite);
|
||||
y += SB_FONTSIZEH + SB_PADDING * 2 + 2;
|
||||
|
||||
VectorSet(headAngles, 0, sin(cg.time * 0.002f) * 20.0f + 180.0f, 0);
|
||||
// VectorSet(headAngles, 0, sin(cg.time * 0.002f) * 20.0f + 180.0f, 0);
|
||||
|
||||
First = 0;
|
||||
for (i = 0; i < cg.numScores; i++) {
|
||||
|
@ -806,16 +806,16 @@ void CG_DrawOldTourneyScoreboard(void)
|
|||
trap_SendClientCommand("score");
|
||||
}
|
||||
|
||||
color[0] = 1;
|
||||
color[1] = 1;
|
||||
color[2] = 1;
|
||||
color[3] = 1;
|
||||
|
||||
// draw the dialog background
|
||||
color[0] = color[1] = color[2] = 0;
|
||||
color[3] = 1;
|
||||
CG_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color);
|
||||
|
||||
color[0] = 1;
|
||||
color[1] = 1;
|
||||
color[2] = 1;
|
||||
color[3] = 1;
|
||||
|
||||
// print the mesage of the day
|
||||
s = CG_ConfigString(CS_MOTD);
|
||||
if (!s[0]) {
|
||||
|
@ -892,13 +892,13 @@ CG_DrawWeaponStats
|
|||
void CG_DrawWeaponStats(void)
|
||||
{
|
||||
int i, offset;
|
||||
float color[4], Alpha, Alpha2;
|
||||
float color[4], Alpha; // Alpha2;
|
||||
int size;
|
||||
char String[80];
|
||||
|
||||
if (cg.time > cg.wstatsStartTime + 300) {
|
||||
Alpha = (cos((cg.time - cg.wstatsStartTime) / 400.0f) + 1.0f) * 0.25f + 0.5f;
|
||||
Alpha2 = (cos((cg.time - cg.wstatsStartTime) / 400.0f) + 1.0f) * 0.5f;
|
||||
// Alpha2 = (cos((cg.time - cg.wstatsStartTime) / 400.0f) + 1.0f) * 0.5f;
|
||||
} else {
|
||||
Alpha = (float) (cg.time - cg.wstatsStartTime) / (float) 300;
|
||||
if (Alpha > 1.0f)
|
||||
|
|
|
@ -879,7 +879,7 @@ int CG_ParseVoiceChats(const char *filename, voiceChatList_t * voiceChatList, in
|
|||
}
|
||||
if (len >= MAX_VOICEFILESIZE) {
|
||||
trap_Print(va
|
||||
(S_COLOR_RED "voice chat file too large: %s is %i, max allowed is %i", filename, len,
|
||||
(S_COLOR_RED "voice chat file too large: %s is %i, max allowed is %i\n", filename, len,
|
||||
MAX_VOICEFILESIZE));
|
||||
trap_FS_FCloseFile(f);
|
||||
return qfalse;
|
||||
|
@ -996,7 +996,7 @@ int CG_HeadModelVoiceChats(char *filename)
|
|||
}
|
||||
if (len >= MAX_VOICEFILESIZE) {
|
||||
trap_Print(va
|
||||
(S_COLOR_RED "voice chat file too large: %s is %i, max allowed is %i", filename, len,
|
||||
(S_COLOR_RED "voice chat file too large: %s is %i, max allowed is %i\n", filename, len,
|
||||
MAX_VOICEFILESIZE));
|
||||
trap_FS_FCloseFile(f);
|
||||
return -1;
|
||||
|
|
|
@ -40,10 +40,10 @@ Q_EXPORT void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) ) {
|
|||
|
||||
int PASSFLOAT(float x)
|
||||
{
|
||||
float floatTemp;
|
||||
floatint_t fi;
|
||||
|
||||
floatTemp = x;
|
||||
return *(int *) &floatTemp;
|
||||
fi.f = x;
|
||||
return fi.i;
|
||||
}
|
||||
|
||||
void trap_Print(const char *fmt)
|
||||
|
|
|
@ -501,7 +501,9 @@ static void CG_OffsetFirstPersonView(void)
|
|||
return;
|
||||
}
|
||||
// add angles based on weapon kick
|
||||
VectorAdd(angles, cg.kick_angles, angles);
|
||||
// This was removed by ioq3 commit 1874
|
||||
//VectorAdd(angles, cg.kick_angles, angles);
|
||||
|
||||
|
||||
// add angles based on damage kick
|
||||
if (cg.damageTime) {
|
||||
|
@ -584,7 +586,8 @@ static void CG_OffsetFirstPersonView(void)
|
|||
|
||||
// add kick offset
|
||||
|
||||
VectorAdd(origin, cg.kick_origin, origin);
|
||||
// This was removed by ioq3 commit 1874
|
||||
//VectorAdd(origin, cg.kick_origin, origin);
|
||||
|
||||
// pivot the eye based on a neck length
|
||||
#if 0
|
||||
|
|
|
@ -267,7 +267,7 @@ Reads information for frame-sound timing
|
|||
static qboolean CG_ParseWeaponSoundFile(const char *filename, weaponInfo_t * weapon)
|
||||
{
|
||||
char *text_p;
|
||||
int len, i, skip;
|
||||
int len, i; // skip;
|
||||
char *token;
|
||||
char text[20000];
|
||||
fileHandle_t f;
|
||||
|
@ -291,7 +291,7 @@ static qboolean CG_ParseWeaponSoundFile(const char *filename, weaponInfo_t * wea
|
|||
// parse the text
|
||||
text_p = text;
|
||||
// Elder: uhh, what was this for?
|
||||
skip = 0; // quite the compiler warning
|
||||
// skip = 0; // quite the compiler warning
|
||||
|
||||
for (i = 0; i < MAX_ANIM_SOUNDS; i++) {
|
||||
// Grab frame number
|
||||
|
@ -344,6 +344,7 @@ static qboolean CG_CalcMuzzlePoint(int entityNum, vec3_t muzzle)
|
|||
VectorCopy(cent->currentState.pos.trBase, muzzle);
|
||||
|
||||
AngleVectors(cent->currentState.apos.trBase, forward, NULL, NULL);
|
||||
|
||||
anim = cent->currentState.legsAnim & ~ANIM_TOGGLEBIT;
|
||||
if (anim == LEGS_WALKCR || anim == LEGS_IDLECR) {
|
||||
muzzle[2] += CROUCH_VIEWHEIGHT;
|
||||
|
@ -365,7 +366,7 @@ CG_ParseWeaponAnimFile
|
|||
static qboolean CG_ParseWeaponAnimFile(const char *filename, weaponInfo_t * weapon)
|
||||
{
|
||||
char *text_p, *token;
|
||||
int len, i, skip;
|
||||
int len, i; // skip;
|
||||
float fps;
|
||||
char text[20000];
|
||||
fileHandle_t f;
|
||||
|
@ -388,7 +389,7 @@ static qboolean CG_ParseWeaponAnimFile(const char *filename, weaponInfo_t * weap
|
|||
|
||||
// parse the text
|
||||
text_p = text;
|
||||
skip = 0; // quite the compiler warning
|
||||
// skip = 0; // quite the compiler warning
|
||||
|
||||
// read information for each frame
|
||||
for (i = 0; i < MAX_WEAPON_ANIMATIONS; i++) {
|
||||
|
@ -525,7 +526,7 @@ CG_RailTrail
|
|||
*/
|
||||
void CG_RailTrail(clientInfo_t * ci, vec3_t start, vec3_t end)
|
||||
{
|
||||
vec3_t axis[36], move, move2, next_move, vec, temp;
|
||||
vec3_t axis[36], move, move2, vec, temp;
|
||||
float len;
|
||||
int i, j, skip;
|
||||
localEntity_t *le;
|
||||
|
@ -569,7 +570,7 @@ void CG_RailTrail(clientInfo_t * ci, vec3_t start, vec3_t end)
|
|||
AxisClear(re->axis);
|
||||
|
||||
VectorMA(move, 20, vec, move);
|
||||
VectorCopy(move, next_move);
|
||||
// VectorCopy(move, next_move);
|
||||
VectorScale(vec, SPACING, vec);
|
||||
|
||||
if (cg_oldRail.integer != 0) {
|
||||
|
@ -771,7 +772,7 @@ void CG_RegisterWeapon(int weaponNum)
|
|||
weaponInfo->firstModel = weaponInfo->weaponModel;
|
||||
}
|
||||
|
||||
weaponInfo->loopFireSound = qfalse;
|
||||
// weaponInfo->loopFireSound = qfalse;
|
||||
|
||||
memset (str, 0, sizeof(str));
|
||||
|
||||
|
@ -1729,7 +1730,7 @@ Add the weapon, and flash for the player's view
|
|||
void CG_AddViewWeapon(playerState_t * ps)
|
||||
{
|
||||
refEntity_t hand;
|
||||
centity_t *cent;
|
||||
// centity_t *cent;
|
||||
float fovOffset;
|
||||
vec3_t angles;
|
||||
weaponInfo_t *weapon;
|
||||
|
@ -1772,7 +1773,7 @@ void CG_AddViewWeapon(playerState_t * ps)
|
|||
fovOffset = 0;
|
||||
}
|
||||
|
||||
cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum];
|
||||
// cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum];
|
||||
CG_RegisterWeapon(ps->weapon);
|
||||
weapon = &cg_weapons[ps->weapon];
|
||||
|
||||
|
@ -1840,7 +1841,7 @@ void CG_DrawWeaponSelect(void)
|
|||
// count the number of weapons owned
|
||||
bits = cg.snap->ps.stats[STAT_WEAPONS];
|
||||
count = 0;
|
||||
for (i = 1; i < 16; i++) {
|
||||
for (i = 1; i < MAX_WEAPONS; i++) {
|
||||
if (bits & (1 << i)) {
|
||||
count++;
|
||||
}
|
||||
|
@ -1849,7 +1850,7 @@ void CG_DrawWeaponSelect(void)
|
|||
x = 320 - count * 20;
|
||||
y = 380;
|
||||
|
||||
for (i = 1; i < 16; i++) {
|
||||
for (i = 1; i < MAX_WEAPONS; i++) {
|
||||
if (!(bits & (1 << i))) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1942,16 +1943,16 @@ void CG_NextWeapon_f(void)
|
|||
cg.weaponSelectTime = cg.time;
|
||||
original = cg.weaponSelect;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (i = 0; i < MAX_WEAPONS; i++) {
|
||||
cg.weaponSelect++;
|
||||
if (cg.weaponSelect == 16) {
|
||||
if (cg.weaponSelect == MAX_WEAPONS) {
|
||||
cg.weaponSelect = 0;
|
||||
}
|
||||
if (CG_WeaponSelectable(cg.weaponSelect)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == 16) {
|
||||
if (i == MAX_WEAPONS) {
|
||||
cg.weaponSelect = original;
|
||||
}
|
||||
//Slicer: Done Server Side
|
||||
|
@ -1995,16 +1996,16 @@ void CG_PrevWeapon_f(void)
|
|||
cg.weaponSelectTime = cg.time;
|
||||
original = cg.weaponSelect;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (i = 0; i < MAX_WEAPONS; i++) {
|
||||
cg.weaponSelect--;
|
||||
if (cg.weaponSelect == -1) {
|
||||
cg.weaponSelect = 15;
|
||||
cg.weaponSelect = MAX_WEAPONS - 1;
|
||||
}
|
||||
if (CG_WeaponSelectable(cg.weaponSelect)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == 16) {
|
||||
if (i == MAX_WEAPONS) {
|
||||
cg.weaponSelect = original;
|
||||
} else {
|
||||
//Slicer: Done Server Side
|
||||
|
@ -2054,9 +2055,9 @@ void CG_SpecialWeapon_f(void)
|
|||
cg.weaponSelectTime = cg.time;
|
||||
original = cg.weaponSelect;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (i = 0; i < MAX_WEAPONS; i++) {
|
||||
cg.weaponSelect++;
|
||||
if (cg.weaponSelect == 16) {
|
||||
if (cg.weaponSelect == MAX_WEAPONS) {
|
||||
cg.weaponSelect = 0;
|
||||
}
|
||||
//Skip normal weapons
|
||||
|
@ -2075,7 +2076,7 @@ void CG_SpecialWeapon_f(void)
|
|||
}
|
||||
|
||||
// FIXME: 15 because of the stupid continue I used
|
||||
if (i >= 15) {
|
||||
if (i >= MAX_WEAPONS - 1) {
|
||||
cg.weaponSelect = original;
|
||||
} else {
|
||||
//Slicer: Done Server Side
|
||||
|
@ -2220,7 +2221,7 @@ void CG_Weapon_f(void)
|
|||
|
||||
num = atoi(CG_Argv(1));
|
||||
|
||||
if (num < 1 || num > 15) {
|
||||
if (num < 1 || num > MAX_WEAPONS - 1) {
|
||||
return;
|
||||
}
|
||||
// JBravo: CTB provisions
|
||||
|
|
Loading…
Reference in a new issue