release 23

This commit is contained in:
Bryce Hutchings 2001-11-25 23:04:08 +00:00
parent bde7cf3a8a
commit feb975fc8b
17 changed files with 1033 additions and 867 deletions

View File

@ -106,7 +106,7 @@ typedef enum {
FOOTSTEP_METAL,
FOOTSTEP_SPLASH,
// Elder: new surface sounds
FOOTSTEP_GRASS,
FOOTSTEP_GRASS,
FOOTSTEP_WOOD,
FOOTSTEP_CARPET,
FOOTSTEP_METAL2,
@ -208,7 +208,7 @@ typedef struct centity_s {
int errorTime; // decay the error from this time
vec3_t errorOrigin;
vec3_t errorAngles;
qboolean extrapolated; // false if origin / angles is an interpolation
vec3_t rawOrigin;
vec3_t rawAngles;
@ -300,7 +300,7 @@ typedef struct localEntity_s {
leMarkType_t leMarkType; // mark to leave on fragment impact
leBounceSoundType_t leBounceSoundType;
refEntity_t refEntity;
refEntity_t refEntity;
} localEntity_t;
//======================================================================
@ -430,7 +430,7 @@ typedef struct weaponInfo_s {
qhandle_t weaponModel; // Third-person/world model
qhandle_t barrelModel;
qhandle_t flashModel;
qhandle_t firstModel; //Elder: view model
qhandle_t animHandModel; //Blaze: for animations
animation_t animations[MAX_WEAPON_ANIMATIONS];
@ -457,11 +457,11 @@ typedef struct weaponInfo_s {
float trailRadius;
float wiTrailTime;
sfxHandle_t readySound;
sfxHandle_t firingSound;
// Elder: sounds to queue
sfxWeapTiming_t animationSounds[MAX_ANIM_SOUNDS];
sfxHandle_t worldReloadSound[3];
@ -502,12 +502,12 @@ typedef struct {
// occurs, and they will have visible effects for #define STEP_TIME or whatever msec after
#define MAX_PREDICTED_EVENTS 16
typedef struct {
int clientFrame; // incremented each frame
int clientNum;
qboolean demoPlayback;
qboolean levelShot; // taking a level menu screenshot
int deferredPlayerLoading;
@ -577,7 +577,7 @@ typedef struct {
refdef_t refdef;
vec3_t refdefViewAngles; // will be converted to refdef.viewaxis
// zoom key
// zoom key
qboolean zoomed; // Determines first-person weapon drawing
int zoomLevel; // Zoom LEVEL! -- uses zoom bits like STAT_RQ3
@ -667,7 +667,7 @@ typedef struct {
int weaponSelectTime;
int weaponAnimation;
int weaponAnimationTime;
// blend blobs
float damageTime;
float damageX, damageY, damageValue;
@ -712,17 +712,17 @@ typedef struct {
// Elder: for message flooding protection
int sayTime;
int sayCount;
int shellHits; //Count number of successful shell hits
qboolean laserSight; //Whether to draw local laser sight
localEntity_t *laserEnt; //Local model -- NULL if not in-use
qboolean rq3_irvision; // Elder: enabled IR vision
int akimboFlash; // Alternate between two tags for flash (0 or 1)
sfxSyncInfo_t curSyncSound; // Shifts after a sound is played
} cg_t;
@ -816,7 +816,7 @@ typedef struct {
qhandle_t akimboFlashModel;
qhandle_t akimbo1stModel;
qhandle_t akimboHandModel;
qhandle_t smoke2;
qhandle_t machinegunBrassModel;
@ -848,7 +848,7 @@ typedef struct {
//Elder: sniper crosshairs
qhandle_t ssgCrosshair[ZOOM_LEVELS];
//Elder: RQ3 hud-related stuff
qhandle_t rq3_healthicon;
qhandle_t rq3_healthicon2;
@ -916,7 +916,7 @@ typedef struct {
qhandle_t rq3_silencerModel;
qhandle_t rq3_laserModel;
qhandle_t rq3_slippersModel;
// weapon effect shaders
qhandle_t railExplosionShader;
qhandle_t plasmaExplosionShader;
@ -1342,6 +1342,8 @@ extern vmCvar_t cg_RQ3_laserAssist;
extern vmCvar_t cg_RQ3_anouncer;
//Elder: different blood types
extern vmCvar_t cg_RQ3_bloodStyle;
//Niceass: Q2-like prediction (or lack of)
extern vmCvar_t cg_RQ3_oldpredict;
extern vmCvar_t cg_drawFriend;
extern vmCvar_t cg_teamChatsOnly;
extern vmCvar_t cg_noVoiceChats;
@ -1428,11 +1430,11 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo
void CG_AdjustFrom640( float *x, float *y, float *w, float *h );
void CG_FillRect( float x, float y, float width, float height, const float *color );
void CG_DrawPic( float x, float y, float width, float height, qhandle_t hShader );
void CG_DrawString( float x, float y, const char *string,
void CG_DrawString( float x, float y, const char *string,
float charWidth, float charHeight, const float *modulate );
void CG_DrawStringExt( int x, int y, const char *string, const float *setColor,
void CG_DrawStringExt( int x, int y, const char *string, const float *setColor,
qboolean forceColor, qboolean shadow, int charWidth, int charHeight, int maxChars );
void CG_DrawBigString( int x, int y, const char *s, float alpha );
void CG_DrawBigStringColor( int x, int y, const char *s, vec4_t color );
@ -1510,9 +1512,9 @@ sfxHandle_t CG_CustomSound( int clientNum, const char *soundName );
void CG_BuildSolidList( void );
int CG_PointContents( const vec3_t point, int passEntityNum );
//Elder: try this
void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
int skipNumber, int mask );
//void CG_Trace( trace_t *result, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end,
//void CG_Trace( trace_t *result, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end,
//int skipNumber, int mask );
void CG_PredictPlayerState( void );
void CG_LoadDeferredPlayers( void );
@ -1535,9 +1537,9 @@ void CG_AddPacketEntities( void );
void CG_Beam( centity_t *cent );
void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out );
void CG_PositionEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
void CG_PositionEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
qhandle_t parentModel, char *tagName );
void CG_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
void CG_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
qhandle_t parentModel, char *tagName );
//Blaze: for weapon animations
void CG_PositionWeaponOnTag( refEntity_t *entity, const refEntity_t *parent, qhandle_t parentModel, char *tagName );
@ -1585,11 +1587,11 @@ void CG_CheckLaser (); //Elder: check laser to see if it's our own
//
void CG_InitMarkPolys( void );
void CG_AddMarks( void );
void CG_ImpactMark( qhandle_t markShader,
const vec3_t origin, const vec3_t dir,
float orientation,
float r, float g, float b, float a,
qboolean alphaFade,
void CG_ImpactMark( qhandle_t markShader,
const vec3_t origin, const vec3_t dir,
float orientation,
float r, float g, float b, float a,
qboolean alphaFade,
float radius, qboolean temporary );
//
@ -1603,8 +1605,8 @@ void CG_FreeLocalEntity( localEntity_t *le );
//
// cg_effects.c
//
localEntity_t *CG_SmokePuff( const vec3_t p,
const vec3_t vel,
localEntity_t *CG_SmokePuff( const vec3_t p,
const vec3_t vel,
float radius,
float r, float g, float b, float a,
float duration,
@ -1754,7 +1756,7 @@ void trap_CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const v
const vec3_t origin, const vec3_t angles );
// Returns the projection of a polygon onto the solid brushes in the world
int trap_CM_MarkFragments( int numPoints, const vec3_t *points,
int trap_CM_MarkFragments( int numPoints, const vec3_t *points,
const vec3_t projection,
int maxPoints, vec3_t pointBuffer,
int maxFragments, markFragment_t *fragmentBuffer );
@ -1801,10 +1803,10 @@ void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float
int trap_R_LightForPoint( vec3_t point, vec3_t ambientLight, vec3_t directedLight, vec3_t lightDir );
void trap_R_RenderScene( const refdef_t *fd );
void trap_R_SetColor( const float *rgba ); // NULL = 1,1,1,1
void trap_R_DrawStretchPic( float x, float y, float w, float h,
void trap_R_DrawStretchPic( float x, float y, float w, float h,
float s1, float t1, float s2, float t2, qhandle_t hShader );
void trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs );
int trap_R_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame,
int trap_R_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame,
float frac, const char *tagName );
void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset );
@ -1836,7 +1838,7 @@ qboolean trap_GetServerCommand( int serverCommandNumber );
// this will always be at least one higher than the number in the current
// snapshot, and it may be quite a few higher if it is a fast computer on
// a lagged connection
int trap_GetCurrentCmdNumber( void );
int trap_GetCurrentCmdNumber( void );
qboolean trap_GetUserCmd( int cmdNumber, usercmd_t *ucmd );

View File

@ -165,6 +165,8 @@ vmCvar_t cg_RQ3_laserAssist;
vmCvar_t cg_RQ3_anouncer;
//Elder: different blood types
vmCvar_t cg_RQ3_bloodStyle;
//NiceAss: Q2-like prediction
vmCvar_t cg_RQ3_oldpredict;
vmCvar_t cg_drawFriend;
vmCvar_t cg_teamChatsOnly;
vmCvar_t cg_noVoiceChats;
@ -190,7 +192,6 @@ vmCvar_t cg_oldRail;
vmCvar_t cg_oldRocket;
vmCvar_t cg_oldPlasma;
vmCvar_t cg_trueLightning;
#ifdef MISSIONPACK
vmCvar_t cg_redTeamName;
vmCvar_t cg_blueTeamName;
@ -346,8 +347,10 @@ static cvarTable_t cvarTable[] = { // bk001129
{ &cg_oldRail, "cg_oldRail", "1", CVAR_ARCHIVE},
{ &cg_oldRocket, "cg_oldRocket", "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 }
// NiceAss: Added:
{ &cg_RQ3_oldpredict, "cg_RQ3_oldpredict", "0", CVAR_ARCHIVE}
};
static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] );
@ -379,7 +382,7 @@ void CG_RegisterCvars( void ) {
trap_Cvar_Register(NULL, "team_headmodel", DEFAULT_TEAM_HEAD, CVAR_USERINFO | CVAR_ARCHIVE );
}
/*
/*
===================
CG_ForceModelChange
===================
@ -549,7 +552,7 @@ static void CG_RegisterItemSounds( int itemNum ) {
len = s-start;
if (len >= MAX_QPATH || len < 5) {
CG_Error( "PrecacheItem: %s has bad precache string",
CG_Error( "PrecacheItem: %s has bad precache string",
item->classname);
return;
}
@ -761,7 +764,7 @@ static void CG_RegisterSounds( void ) {
//Elder: new footsteps
Com_sprintf (name, sizeof(name), "sound/player/footsteps/gravel%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_GRASS][i] = trap_S_RegisterSound (name, qfalse);
Com_sprintf (name, sizeof(name), "sound/player/footsteps/wood%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_WOOD][i] = trap_S_RegisterSound (name, qfalse);
@ -1064,25 +1067,25 @@ static void CG_RegisterGraphics( void ) {
cgs.media.glass01 = trap_R_RegisterModel( "models/breakables/glass01.md3" );
cgs.media.glass02 = trap_R_RegisterModel( "models/breakables/glass02.md3" );
cgs.media.glass03 = trap_R_RegisterModel( "models/breakables/glass03.md3" );
//Elder: additional debris
//Todo: load only if in the level
cgs.media.wood01 = trap_R_RegisterModel( "models/breakables/wood01.md3" );
cgs.media.wood02 = trap_R_RegisterModel( "models/breakables/wood02.md3" );
cgs.media.wood03 = trap_R_RegisterModel( "models/breakables/wood03.md3" );
cgs.media.metal01 = trap_R_RegisterModel( "models/breakables/metal01.md3" );
cgs.media.metal02 = trap_R_RegisterModel( "models/breakables/metal02.md3" );
cgs.media.metal03 = trap_R_RegisterModel( "models/breakables/metal03.md3" );
cgs.media.ceramic01 = trap_R_RegisterModel( "models/breakables/ceramic01.md3" );
cgs.media.ceramic02 = trap_R_RegisterModel( "models/breakables/ceramic02.md3" );
cgs.media.ceramic03 = trap_R_RegisterModel( "models/breakables/ceramic03.md3" );
cgs.media.paper01 = trap_R_RegisterModel( "models/breakables/paper01.md3" );
cgs.media.paper02 = trap_R_RegisterModel( "models/breakables/paper02.md3" );
cgs.media.paper03 = trap_R_RegisterModel( "models/breakables/paper03.md3" );
cgs.media.brick01 = trap_R_RegisterModel( "models/breakables/brick01.md3" );
cgs.media.brick02 = trap_R_RegisterModel( "models/breakables/brick02.md3" );
cgs.media.brick03 = trap_R_RegisterModel( "models/breakables/brick03.md3" );
@ -1113,7 +1116,7 @@ static void CG_RegisterGraphics( void ) {
cgs.media.bulletFlashModel = trap_R_RegisterModel("models/weaphits/bullet.md3");
cgs.media.ringFlashModel = trap_R_RegisterModel("models/weaphits/ring02.md3");
cgs.media.dishFlashModel = trap_R_RegisterModel("models/weaphits/boom01.md3");
// Elder: added
cgs.media.hitSparkModel = trap_R_RegisterModel("models/weaphits/tracer/tracer.md3");
cgs.media.hitSparkShader = trap_R_RegisterShader("models/weaphits/tracer/tracer");
@ -1159,7 +1162,7 @@ static void CG_RegisterGraphics( void ) {
//Elder: other hud-related elements
cgs.media.rq3_healthicon = trap_R_RegisterShaderNoMip( "gfx/rq3_hud/hud_health" );
cgs.media.rq3_healthicon2 = trap_R_RegisterShaderNoMip( "gfx/rq3_hud/hud_healthwarning" );
memset( cg_items, 0, sizeof( cg_items ) );
memset( cg_weapons, 0, sizeof( cg_weapons ) );
@ -1256,7 +1259,7 @@ static void CG_RegisterGraphics( void ) {
/*
/*
=======================
CG_BuildSpectatorString
@ -1278,7 +1281,7 @@ void CG_BuildSpectatorString() {
}
/*
/*
===================
CG_RegisterClients
===================
@ -1377,7 +1380,7 @@ qboolean CG_Asset_Parse(int handle) {
if (Q_stricmp(token.string, "{") != 0) {
return qfalse;
}
while ( 1 ) {
if (!trap_PC_ReadToken(handle, &token))
return qfalse;
@ -1573,7 +1576,7 @@ qboolean CG_Load_Menu(char **p) {
while ( 1 ) {
token = COM_ParseExt(p, qtrue);
if (Q_stricmp(token, "}") == 0) {
return qtrue;
}
@ -1582,7 +1585,7 @@ qboolean CG_Load_Menu(char **p) {
return qfalse;
}
CG_ParseMenu(token);
CG_ParseMenu(token);
}
return qfalse;
}
@ -1616,7 +1619,7 @@ void CG_LoadMenus(const char *menuFile) {
trap_FS_Read( buf, len, f );
buf[len] = 0;
trap_FS_FCloseFile( f );
COM_Compress(buf);
Menu_Reset();
@ -1813,7 +1816,7 @@ static const char *CG_FeederItemText(float feederID, int index, int column, qhan
case 6:
if ( sp->ping == -1 ) {
return "connecting";
}
}
return va("%4i", sp->ping);
break;
}
@ -1918,7 +1921,7 @@ void CG_LoadHudMenu() {
cgDC.registerModel = &trap_R_RegisterModel;
cgDC.modelBounds = &trap_R_ModelBounds;
cgDC.fillRect = &CG_FillRect;
cgDC.drawRect = &CG_DrawRect;
cgDC.drawRect = &CG_DrawRect;
cgDC.drawSides = &CG_DrawSides;
cgDC.drawTopBottom = &CG_DrawTopBottom;
cgDC.clearScene = &trap_R_ClearScene;
@ -1946,8 +1949,8 @@ void CG_LoadHudMenu() {
//cgDC.getBindingBuf = &trap_Key_GetBindingBuf;
//cgDC.keynumToStringBuf = &trap_Key_KeynumToStringBuf;
//cgDC.executeText = &trap_Cmd_ExecuteText;
cgDC.Error = &Com_Error;
cgDC.Print = &Com_Printf;
cgDC.Error = &Com_Error;
cgDC.Print = &Com_Printf;
cgDC.ownerDrawWidth = &CG_OwnerDrawWidth;
//cgDC.Pause = &CG_Pause;
cgDC.registerSound = &trap_S_RegisterSound;
@ -1957,11 +1960,11 @@ void CG_LoadHudMenu() {
cgDC.stopCinematic = &CG_StopCinematic;
cgDC.drawCinematic = &CG_DrawCinematic;
cgDC.runCinematicFrame = &CG_RunCinematicFrame;
Init_Display(&cgDC);
Menu_Reset();
trap_Cvar_VariableStringBuffer("cg_hudFiles", buff, sizeof(buff));
hudSet = buff;
if (hudSet[0] == '\0') {

View File

@ -125,7 +125,7 @@ Elder: changed header - added 'const' to mins and maxs so VMs can compile
Also check cg_syscalls.c and cg_local.h
================
*/
void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
int skipNumber, int mask ) {
trace_t t;
@ -227,10 +227,10 @@ static void CG_InterpolatePlayerState( qboolean grabAngles ) {
for ( i = 0 ; i < 3 ; i++ ) {
out->origin[i] = prev->ps.origin[i] + f * (next->ps.origin[i] - prev->ps.origin[i] );
if ( !grabAngles ) {
out->viewangles[i] = LerpAngle(
out->viewangles[i] = LerpAngle(
prev->ps.viewangles[i], next->ps.viewangles[i], f );
}
out->velocity[i] = prev->ps.velocity[i] +
out->velocity[i] = prev->ps.velocity[i] +
f * (next->ps.velocity[i] - prev->ps.velocity[i] );
}
@ -262,9 +262,9 @@ static void CG_TouchItem( centity_t *cent ) {
if ( !BG_CanItemBeGrabbed( cgs.gametype, &cent->currentState, &cg.predictedPlayerState ) ) {
return; // can't hold it
}
// Special case for flags.
// Special case for flags.
// We don't predict touching our own flag
#ifdef MISSIONPACK
if( cgs.gametype == GT_1FCTF ) {
@ -347,7 +347,7 @@ static void CG_TouchTriggerPrediction( void ) {
continue;
}
trap_CM_BoxTrace( &trace, cg.predictedPlayerState.origin, cg.predictedPlayerState.origin,
trap_CM_BoxTrace( &trace, cg.predictedPlayerState.origin, cg.predictedPlayerState.origin,
cg_pmove.mins, cg_pmove.maxs, cmodel, -1 );
if ( !trace.startsolid ) {
@ -451,7 +451,7 @@ void CG_PredictPlayerState( void ) {
// the last good position we had
cmdNum = current - CMD_BACKUP + 1;
trap_GetUserCmd( cmdNum, &oldestCmd );
if ( oldestCmd.serverTime > cg.snap->ps.commandTime
if ( oldestCmd.serverTime > cg.snap->ps.commandTime
&& oldestCmd.serverTime < cg.time ) { // special check for map_restart
if ( cg_showmiss.integer ) {
CG_Printf ("exceeded PACKET_BACKUP on commands\n");
@ -464,7 +464,7 @@ void CG_PredictPlayerState( void ) {
// get the most recent information we have, even if
// the server time is beyond our current cg.time,
// because predicted player positions are going to
// because predicted player positions are going to
// be ahead of everything else anyway
if ( cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport ) {
cg.predictedPlayerState = cg.nextSnap->ps;
@ -522,7 +522,7 @@ void CG_PredictPlayerState( void ) {
cg.thisFrameTeleport = qfalse;
} else {
vec3_t adjusted;
CG_AdjustPositionForMover( cg.predictedPlayerState.origin,
CG_AdjustPositionForMover( cg.predictedPlayerState.origin,
cg.predictedPlayerState.groundEntityNum, cg.physicsTime, cg.oldTime, adjusted );
if ( cg_showmiss.integer ) {
@ -588,9 +588,9 @@ void CG_PredictPlayerState( void ) {
else if (cg.snap->ps.stats[STAT_BURST] > 0)
cg_pmove.cmd.buttons |= BUTTON_ATTACK;
}*/
Pmove (&cg_pmove);
moved = qtrue;
// add push trigger movement effects
@ -612,8 +612,8 @@ void CG_PredictPlayerState( void ) {
}
// adjust for the movement of the groundentity
CG_AdjustPositionForMover( cg.predictedPlayerState.origin,
cg.predictedPlayerState.groundEntityNum,
CG_AdjustPositionForMover( cg.predictedPlayerState.origin,
cg.predictedPlayerState.groundEntityNum,
cg.physicsTime, cg.time, cg.predictedPlayerState.origin );
if ( cg_showmiss.integer ) {
@ -622,6 +622,10 @@ void CG_PredictPlayerState( void ) {
}
}
// NiceAss: Added to remove prediction (like q2).
if (cg_RQ3_oldpredict.integer)
return;
// fire events and other transition triggered things
CG_TransitionPlayerState( &cg.predictedPlayerState, &oldPlayerState );

View File

@ -22,7 +22,7 @@ enhanced into a single model testing facility.
Model viewing can begin with either "testmodel <modelname>" or "testgun <modelname>".
The names must be the full pathname after the basedir, like
The names must be the full pathname after the basedir, like
"models/weapons/v_launch/tris.md3" or "players/male/tris.md3"
Testmodel will create a fake entity 100 units in front of the current view
@ -280,11 +280,11 @@ static void CG_OffsetThirdPersonView( void ) {
// this causes a compiler bug on mac MrC compiler
static void CG_StepOffset( void ) {
int timeDelta;
// smooth out stair climbing
timeDelta = cg.time - cg.stepTime;
if ( timeDelta < STEP_TIME ) {
cg.refdef.vieworg[2] -= cg.stepChange
cg.refdef.vieworg[2] -= cg.stepChange
* (STEP_TIME - timeDelta) / STEP_TIME;
}
}
@ -305,7 +305,7 @@ static void CG_OffsetFirstPersonView( void ) {
float f;
vec3_t predictedVelocity;
int timeDelta;
if ( cg.snap->ps.pm_type == PM_INTERMISSION ) {
return;
}
@ -354,7 +354,7 @@ static void CG_OffsetFirstPersonView( void ) {
delta = DotProduct ( predictedVelocity, cg.refdef.viewaxis[0]);
angles[PITCH] += delta * cg_runpitch.value;
delta = DotProduct ( predictedVelocity, cg.refdef.viewaxis[1]);
angles[ROLL] -= delta * cg_runroll.value;
@ -382,7 +382,7 @@ static void CG_OffsetFirstPersonView( void ) {
// smooth out duck height changes
timeDelta = cg.time - cg.duckTime;
if ( timeDelta < DUCK_TIME) {
cg.refdef.vieworg[2] -= cg.duckChange
cg.refdef.vieworg[2] -= cg.duckChange
* (DUCK_TIME - timeDelta) / DUCK_TIME;
}
@ -418,7 +418,7 @@ static void CG_OffsetFirstPersonView( void ) {
{
#define NECK_LENGTH 8
vec3_t forward, up;
cg.refdef.vieworg[2] -= NECK_LENGTH;
AngleVectors( cg.refdefViewAngles, forward, NULL, up );
VectorMA( cg.refdef.vieworg, 3, forward, cg.refdef.vieworg );
@ -430,7 +430,7 @@ static void CG_OffsetFirstPersonView( void ) {
if (cg.kick_time)
{
int duration;
if (cg.kick_duration)
duration = cg.kick_duration;
else
@ -467,7 +467,7 @@ static void CG_OffsetFirstPersonView( void ) {
/* hawkins: not needed in rxn as is. however, useful for SSG. */
/*
void CG_ZoomDown_f( void ) {
void CG_ZoomDown_f( void ) {
if ( cg.zoomed ) {
return;
}
@ -475,7 +475,7 @@ void CG_ZoomDown_f( void ) {
cg.zoomTime = cg.time;
}
void CG_ZoomUp_f( void ) {
void CG_ZoomUp_f( void ) {
if ( !cg.zoomed ) {
return;
}
@ -571,7 +571,7 @@ static int CG_CalcFov( void ) {
*/
if (cg_RQ3_ssgZoomAssist.integer == 0)
CG_RQ3_SyncZoom();
//SSG3000 zoom handling
/*
// old code
@ -622,7 +622,7 @@ static int CG_CalcFov( void ) {
fov_x = fov_x + f * ( zoomFov - fov_x );
}
//Idle state or out of ammo
else if (cg.snap->ps.weaponTime == 0 &&
else if (cg.snap->ps.weaponTime == 0 &&
cg.snap->ps.stats[STAT_RELOADTIME] == 0)
{
fov_x = CG_RQ3_GetFov();
@ -643,7 +643,7 @@ static int CG_CalcFov( void ) {
else if (cg.snap->ps.weaponTime < ZOOM_TIME &&
cg.snap->ps.stats[STAT_RELOADTIME] < ZOOM_TIME &&
!(cg.snap->ps.stats[STAT_RQ3] & RQ3_FASTRELOADS))
{
{
if (cg.zoomFirstReturn == ZOOM_OUT ||
cg.zoomFirstReturn == ZOOM_OUTOFAMMO && cg.snap->ps.stats[STAT_RELOADTIME] > 0)
{
@ -663,7 +663,7 @@ static int CG_CalcFov( void ) {
if ( f > 1.0 || cg.zoomFirstReturn == ZOOM_OUTOFAMMO)
fov_x = zoomFov;
else
fov_x = fov_x + f * ( zoomFov - fov_x );
fov_x = fov_x + f * ( zoomFov - fov_x );
//fov_x = zoomFov + f * ( fov_x - zoomFov );
}
//first time after a shot or reload - zoom out
@ -674,9 +674,9 @@ static int CG_CalcFov( void ) {
cg.zoomTime = cg.time;
cg.zoomFirstReturn = ZOOM_OUT;
}
fov_x = CG_RQ3_GetFov();
if (cg.zoomFirstReturn == ZOOM_OUTOFAMMO &&
cg.snap->ps.stats[STAT_RELOADATTEMPTS] == 0)// &&
//cg.snap->ps.weaponstate != WEAPON_RELOADING)
@ -769,7 +769,7 @@ static int CG_CalcFov( void ) {
cg.snap->ps.weaponstate == WEAPON_RAISING ) &&
cg.snap->ps.stats[STAT_RELOADTIME] < ZOOM_TIME &&
!(cg.snap->ps.stats[STAT_RQ3] & RQ3_FASTRELOADS))
{
{
if (cg.zoomFirstReturn == ZOOM_OUT)
{
cg.zoomTime = cg.time;
@ -791,7 +791,7 @@ static int CG_CalcFov( void ) {
if ( f > 1.0 ) //|| cg.zoomFirstReturn == ZOOM_OUTOFAMMO)
fov_x = zoomFov;
else
fov_x = fov_x + f * ( zoomFov - fov_x );
fov_x = fov_x + f * ( zoomFov - fov_x );
//fov_x = zoomFov + f * ( fov_x - zoomFov );
}
//first time after a shot, reload, or weapon switch - zoom out
@ -811,8 +811,8 @@ static int CG_CalcFov( void ) {
cg.zoomTime = cg.time;
cg.zoomFirstReturn = ZOOM_OUT;
}
if (cg.zoomFirstReturn == ZOOM_OUTOFAMMO)
{
zoomFov = fov_x;
@ -905,7 +905,7 @@ static void CG_DamageBlendBlob( void ) {
int t;
int maxTime;
refEntity_t ent;
if ( !cg.damageValue ) {
return;
}
@ -1229,18 +1229,19 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo
//Blaze: Check for invalid video settings.
for(i=0;i<30;i++)
{
if (strcmp(cheats[i].cvar, NULL)!=0)
if (strcmp(cheats[i].cvar, NULL)!=0)
{
cvar_val = CG_Cvar_Get(cheats[i].cvar);
//CG_Printf("%s is set to %f\n",cheats[i].cvar, cvar_val);
if ( cvar_val < cheats[i].low || cvar_val > cheats[i].high)
if ( (cvar_val < cheats[i].low || cvar_val > cheats[i].high) )
{
CG_Printf("This server restricts %s to be between %1.11f and %1.11f\n",cheats[i].cvar,cheats[i].low, cheats[i].high);
trap_Cvar_Set("RQ3_CvarKickReason", cheats[i].cvar );
trap_SendConsoleCommand(va("disconnect\n"));
}
}
}
}
}

View File

@ -1710,6 +1710,12 @@ void CG_AddViewWeapon( playerState_t *ps ) {
}
// Added by NiceAss so sounds will be played even if the weapon isn't drawn.
if ( !cg_drawGun.integer && (cg.snap->ps.stats[STAT_RQ3] & RQ3_THROWWEAPON) != RQ3_THROWWEAPON) {
// NiceAss: TODO--Play sounds even if cg_drawGun.integer == 0 (helps the player know
// when bandaging is completed.
}
// allow the gun to be completely removed
// Elder: don't draw if throwing
// if ( !cg_drawGun.integer || (cg.snap->ps.stats[STAT_RQ3] & RQ3_THROWWEAPON) == RQ3_THROWWEAPON) {
@ -1760,7 +1766,7 @@ void CG_AddViewWeapon( playerState_t *ps ) {
rxn_gunx += 10;
}
if ((cg_RQ3_drawWeapon.integer > 1 ) && (cg_RQ3_drawWeapon.integer < 4 ))
{
rxn_guny = cg_gun_y.value + 4*(cg_RQ3_drawWeapon.integer-1);
@ -3176,7 +3182,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
color[1] = 96;
color[2] = 64;
color[3] = 192;
break;
break;
case WP_M3:
case WP_HANDCANNON:
flashCount = 2 + rand() % 3;
@ -3194,7 +3200,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
color[3] = 192;
break;
}
// Elder: should probably dump this into another function
for ( i = 0; i < flashCount; i++ )
{
@ -3214,20 +3220,20 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
VectorMA( origin, scale + 0.5f, temp, le->refEntity.origin );
VectorCopy(temp, le->refEntity.axis[0]);
// set spark colour
le->refEntity.shaderRGBA[0] = color[0];
le->refEntity.shaderRGBA[1] = color[1];
le->refEntity.shaderRGBA[2] = color[2];
le->refEntity.shaderRGBA[3] = color[3];
// readjust behaviour
le->leType = LE_MOVE_SCALE_FADE;
le->pos.trType = TR_LINEAR;
le->pos.trTime = cg.time;
VectorCopy(le->refEntity.origin, le->pos.trBase);
VectorScale(offsetDir, 30, le->pos.trDelta);
le->light = light;
VectorCopy( lightColor, le->lightColor );
}

View File

@ -1653,7 +1653,7 @@ static void PM_CheckDuck (void)
pm->trace (&trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask);
if ( trace.fraction == 1.0 && !pml.ladder) {
if ( trace.fraction == 1.0 && !pml.ladder && !(pm->ps->pm_flags & PMF_DUCKED)) {
pm->maxs[2] = 32;
pm->ps->viewheight = DEFAULT_VIEWHEIGHT;
return;
@ -1867,7 +1867,6 @@ static void PM_BeginWeaponChange( int weapon ) {
//Elder: ignore disarm delays when throwing a weapon
if (pm->ps->stats[STAT_RQ3] & RQ3_THROWWEAPON)
{
//Com_Printf("Got to throw skip\n");
pm->ps->stats[STAT_RQ3] &= ~RQ3_THROWWEAPON;
pm->ps->weaponTime = 0;
}
@ -1925,8 +1924,9 @@ static void PM_BeginWeaponChange( int weapon ) {
*/
if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_StartWeaponAnim(WP_ANIM_THROWDISARM);
else
else {
PM_StartWeaponAnim(WP_ANIM_DISARM);
}
}
// Elder: cancel reload stuff here
@ -1941,6 +1941,12 @@ static void PM_BeginWeaponChange( int weapon ) {
pm->ps->weaponstate = WEAPON_DROPPING;
// NiceAss: Added this. Is it a hack?
if (pm->ps->weapon == WP_GRENADE && pm->ps->ammo[pm->ps->weapon] == 0) {
pm->ps->weaponTime = 0;
return;
}
//Elder: temp hack
/*
if (pm->ps->weapon == WP_PISTOL ||
@ -1954,10 +1960,12 @@ static void PM_BeginWeaponChange( int weapon ) {
(pm->ps->weapon == WP_KNIFE && (pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
PM_StartWeaponAnim(WP_ANIM_DISARM);
else*/
if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_StartWeaponAnim(WP_ANIM_THROWDISARM);
else
else {
PM_StartWeaponAnim(WP_ANIM_DISARM);
}
PM_StartTorsoAnim( TORSO_DROP );
}
@ -2041,6 +2049,7 @@ static void PM_FinishWeaponChange( void ) {
PM_StartWeaponAnim(WP_ANIM_ACTIVATE);
*/
/*else*/
if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_StartWeaponAnim(WP_ANIM_THROWACTIVATE);
else
@ -2521,7 +2530,7 @@ static void PM_Weapon( void ) {
}
else if (pm->ps->stats[STAT_BURST])
{
pm->ps->weaponTime += 150; // 200
pm->ps->weaponTime += 100; // lowered again to 100 from 150 from 200
pm->ps->stats[STAT_BURST] = 0;
}
}
@ -2562,6 +2571,15 @@ static void PM_Weapon( void ) {
}
*/
//NiceAss: I added this smoother M4 rise. Should this be used?
/*
if ( ( pm->cmd.buttons & 1 || pm->ps->stats[STAT_BURST] ) && pm->ps->ammo[pm->ps->weapon]) {
if ( pm->ps->weapon == WP_M4)
{
pm->ps->delta_angles[0] = ANGLE2SHORT(SHORT2ANGLE(pm->ps->delta_angles[0]) - 0.08);
}
}
*/
// make weapon function
if ( pm->ps->weaponTime > 0 ) {
@ -2590,7 +2608,6 @@ static void PM_Weapon( void ) {
PM_AddEvent( EV_FIRE_WEAPON );
pm->ps->ammo[WP_GRENADE]--;
}
PM_BeginWeaponChange( pm->cmd.weapon );
}
else
@ -2598,8 +2615,9 @@ static void PM_Weapon( void ) {
//Elder: temp hack
if (pm->ps->weaponstate == WEAPON_READY)
{
if (pm->ps->ammo[pm->ps->weapon] == 0)
if (pm->ps->ammo[pm->ps->weapon] == 0) {
PM_ContinueWeaponAnim( WP_ANIM_EMPTY );
}
/*
else if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
@ -2613,8 +2631,9 @@ static void PM_Weapon( void ) {
PM_ContinueWeaponAnim(WP_ANIM_IDLE);
*/
else if (pm->ps->weapon == WP_KNIFE &&
!(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
!(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)) {
PM_ContinueWeaponAnim(WP_ANIM_THROWIDLE);
}
else
PM_ContinueWeaponAnim(WP_ANIM_IDLE);
}
@ -2636,6 +2655,7 @@ static void PM_Weapon( void ) {
pm->ps->stats[STAT_WEAPONS] &= ~( 1 << WP_GRENADE);
}*/
// Elder: added STAT_RELOADTIME and STAT_WEAPONSTALLTIME check
if ( pm->ps->weaponTime > 0 || pm->ps->stats[STAT_RELOADTIME] > 0 ||
pm->ps->stats[STAT_WEAPONSTALLTIME] > 0) {
@ -2660,8 +2680,9 @@ static void PM_Weapon( void ) {
// Should always draw the weapon when it is just ready
// PM_StartWeaponAnim( WP_ANIM_READY );
// temp hack
if (pm->ps->ammo[pm->ps->weapon] == 0)
if (pm->ps->ammo[pm->ps->weapon] == 0) {
PM_ContinueWeaponAnim( WP_ANIM_EMPTY );
}
/*
else if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
@ -2698,7 +2719,8 @@ static void PM_Weapon( void ) {
PM_ContinueWeaponAnim(WP_ANIM_EXTRA1);
return;
}
else if ( pm->ps->weaponstate == WEAPON_COCKED )
// NiceAss: Fix for the double-grenade bug (pm->ps->weaponstate == WEAPON_FIRING)
else if ( pm->ps->weaponstate == WEAPON_COCKED || pm->ps->weaponstate == WEAPON_FIRING)
return;
}
// Elder: stall the thrown knife action
@ -2733,10 +2755,6 @@ static void PM_Weapon( void ) {
*/
}
// check for fireA release
// if they aren't pressing attack
if ( !(pm->cmd.buttons & 1) ) {
@ -2871,6 +2889,7 @@ static void PM_Weapon( void ) {
}
}
pm->ps->weaponstate = WEAPON_FIRING;
// Elder: akimbo check to auto-fire the second bullet

View File

@ -279,7 +279,7 @@ typedef enum {
#define GRENADE_LONG_SPEED 920
//Elder: knife throw speed - from the AQ2 source
#define THROW_SPEED 1100 // NiceAss: Changed to 1100 (from 1200)
#define THROW_SPEED 1200 // NiceAss: Changed to 1100 (from 1200)
//Elder: special flag needed in both games
#define FL_THROWN_KNIFE 0x00040000 // Elder: thrown knife special case

View File

@ -588,7 +588,8 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
// ent->client->ps.weaponstate = WEAPON_RAISING;
// ent->client->ps.torsoAnim = ( ( ent->client->ps.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | TORSO_RAISE;
// NiceAss: clear last player to hit you.
ent->client->lasthurt_mod = 0;
}
}

View File

@ -236,7 +236,7 @@ gentity_t *SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles )
if ( spot == nearestSpot ) {
// last try
spot = SelectRandomDeathmatchSpawnPoint ( );
}
}
}
// find a single player start spot
@ -334,7 +334,7 @@ void BodySink( gentity_t *ent ) {
// the body ques are never actually freed, they are just unlinked
trap_UnlinkEntity( ent );
ent->physicsObject = qfalse;
return;
return;
}
ent->nextthink = level.time + 100;
ent->s.pos.trBase[2] -= 1;
@ -731,7 +731,7 @@ void ClientUserinfoChanged( int clientNum ) {
if ( client->pers.connected == CON_CONNECTED ) {
if ( strcmp( oldname, client->pers.netname ) ) {
trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " renamed to %s\n\"", oldname,
trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " renamed to %s\n\"", oldname,
client->pers.netname) );
}
}
@ -848,12 +848,12 @@ void ClientUserinfoChanged( int clientNum ) {
// print scoreboards, display models, and play custom sounds
if ( ent->r.svFlags & SVF_BOT ) {
s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\skill\\%s\\tt\\%d\\tl\\%d",
client->pers.netname, team, model, headModel, c1, c2,
client->pers.netname, team, model, headModel, c1, c2,
client->pers.maxHealth, client->sess.wins, client->sess.losses,
Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader );
} else {
s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d",
client->pers.netname, client->sess.sessionTeam, model, headModel, redTeam, blueTeam, c1, c2,
client->pers.netname, client->sess.sessionTeam, model, headModel, redTeam, blueTeam, c1, c2,
client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader);
}
@ -895,12 +895,12 @@ int G_SendCheatVars(int clientNum)
trap_FS_Read( text, len, f );
text[len] = 0;
trap_FS_FCloseFile( f );
// parse the text
text_p = text;
skip = 0; // quite the compiler warning
for ( i = 0 ; i < 30 ; i++ ) {
for ( i = 0 ; i < 30 ; i++ ) {
token = COM_Parse( &text_p );
if ( !token ) break;
if (strlen(token) >=40)
@ -912,11 +912,11 @@ int G_SendCheatVars(int clientNum)
if ( !strcmp(token, NULL)) return qtrue;
token = COM_Parse( &text_p );
if ( !token ) break;
lowval = atof( token );
lowval = atof( token );
token = COM_Parse( &text_p );
if ( !token ) break;
highval = atof( token );
highval = atof( token );
Com_sprintf(cl_cheatvar, sizeof(cl_cheatvar),"addCheatVar %s %f %f\n",cheatVar,lowval,highval);
//Com_Printf("%s", cl_cheatvar);
trap_SendServerCommand(clientNum, va("%s",cl_cheatvar));
@ -1139,13 +1139,13 @@ void ClientSpawn(gentity_t *ent) {
// do it before setting health back up, so farthest
// ranging doesn't count this client
if ( client->sess.sessionTeam == TEAM_SPECTATOR ) {
spawnPoint = SelectSpectatorSpawnPoint (
spawnPoint = SelectSpectatorSpawnPoint (
spawn_origin, spawn_angles);
} else if (g_gametype.integer >= GT_CTF ) {
// all base oriented team games use the CTF spawn points
spawnPoint = SelectCTFSpawnPoint (
client->sess.sessionTeam,
client->pers.teamState.state,
spawnPoint = SelectCTFSpawnPoint (
client->sess.sessionTeam,
client->pers.teamState.state,
spawn_origin, spawn_angles);
} else {
do {
@ -1155,8 +1155,8 @@ void ClientSpawn(gentity_t *ent) {
spawnPoint = SelectInitialSpawnPoint( spawn_origin, spawn_angles );
} else {
// don't spawn near existing origin if possible
spawnPoint = SelectSpawnPoint (
client->ps.origin,
spawnPoint = SelectSpawnPoint (
client->ps.origin,
spawn_origin, spawn_angles);
}
@ -1225,7 +1225,7 @@ void ClientSpawn(gentity_t *ent) {
client->accuracy_hits = accuracy_hits;
client->accuracy_shots = accuracy_shots;
client->lastkilled_client = -1;
for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
client->ps.persistant[i] = persistant[i];
}
@ -1257,7 +1257,7 @@ void ClientSpawn(gentity_t *ent) {
ent->waterlevel = 0;
ent->watertype = 0;
ent->flags = 0;
VectorCopy (playerMins, ent->r.mins);
VectorCopy (playerMaxs, ent->r.maxs);
@ -1331,7 +1331,7 @@ void ClientSpawn(gentity_t *ent) {
//Elder: reset all RQ3 non-persistent stats
ent->client->ps.stats[STAT_RQ3] = 0;
//Elder: set weaponfireNextTime amount
client->weaponfireNextTime = 0;
@ -1346,9 +1346,9 @@ void ClientSpawn(gentity_t *ent) {
client->ps.torsoAnim = TORSO_STAND;
client->ps.legsAnim = LEGS_IDLE;
// weapon animations
client->ps.generic1 = ( ( client->ps.generic1 & ANIM_TOGGLEBIT )
client->ps.generic1 = ( ( client->ps.generic1 & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | WP_ANIM_IDLE;
if ( level.intermissiontime ) {
MoveClientToIntermission( ent );
} else {
@ -1432,7 +1432,7 @@ void ClientDisconnect( int clientNum ) {
}
// send effect if they were completely connected
if ( ent->client->pers.connected == CON_CONNECTED
if ( ent->client->pers.connected == CON_CONNECTED
&& ent->client->sess.sessionTeam != TEAM_SPECTATOR ) {
tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_OUT );
tent->s.clientNum = ent->s.clientNum;

File diff suppressed because it is too large Load Diff

View File

@ -660,6 +660,7 @@ const char *BuildShaderStateConfig();
//
// g_combat.c
//
qboolean G_HitPlayer ( gentity_t *targ, vec3_t dir, vec3_t point ); // Added by NiceAss for new head hit-detection
qboolean CanDamage (gentity_t *targ, vec3_t origin);
void G_Damage (gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod);
qboolean G_RadiusDamage (vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, int mod);

View File

@ -287,7 +287,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
return;
}
*/
#ifdef MISSIONPACK
if ( other->takedamage ) {
if ( ent->s.weapon != WP_PROX_LAUNCHER ) {
@ -327,7 +327,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
if ( VectorLength( velocity ) == 0 ) {
velocity[2] = 1; // stepped on a grenade
}
//Elder: added
//Blaze: Moved down into the section where it actually hits the glass, otherwise the breakable entity is gone when it checks for it
/*if ( ent->s.weapon == WP_KNIFE && other->s.eType == ET_BREAKABLE ) {
@ -438,8 +438,8 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
if (ent->s.weapon == WP_KNIFE) {
if ( other->takedamage && other->client) {
// Elder: must add it in here if we remove it from above
G_Damage (other, ent, &g_entities[ent->r.ownerNum], velocity, ent->s.origin, THROW_DAMAGE, 0, MOD_KNIFE_THROWN);
// NiceAss: Fixed knife-leg damage bug here. Passed it the wrong vector I guess...
G_Damage (other, ent, &g_entities[ent->r.ownerNum], velocity, ent->r.currentOrigin, THROW_DAMAGE, 0, MOD_KNIFE_THROWN);
//hit a player - send the gurgle or embedding sound event
}
else {
@ -451,8 +451,8 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
//spawn a knife at its trajectory end-point
xr_item = BG_FindItemForWeapon( WP_KNIFE );
BG_EvaluateTrajectoryDelta(&ent->s.pos, level.time, knifeVelocity);
BG_EvaluateTrajectoryDelta(&ent->s.pos, level.time, knifeVelocity);
if (other->s.eType == ET_BREAKABLE) {
VectorScale(knifeVelocity, -0.25, knifeVelocity);
//Blaze: Moved from above, now deal the damage to the glass, and let the knife drop
@ -463,22 +463,22 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
velocity[2] = 0;
G_Damage (other, ent, &g_entities[ent->r.ownerNum], velocity, origin, THROW_DAMAGE, 0, MOD_KNIFE_THROWN);
}
//breakable "hit"; make it fall to the ground
xr_drop = LaunchItem(xr_item, trace->endpos, velocity, FL_DROPPED_ITEM);
//but still set it as a thrown knife
//xr_drop->flags |= FL_THROWN_KNIFE;
//Elder: move the knife back a bit more
//and transfer into shared entityState
VectorScale(trace->plane.normal, 16, temp);
VectorAdd(trace->endpos, temp, knifeOffset);
//VectorCopy(xr_drop->s.origin, temp);
VectorAdd(xr_drop->s.origin, knifeOffset, xr_drop->s.origin);
VectorCopy(xr_drop->s.origin, xr_drop->r.currentOrigin);
}
else {
@ -492,14 +492,14 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
VectorNormalize(temp);
VectorScale(temp, -4, temp);
VectorAdd(trace->endpos, temp, knifeOffset);
//VectorCopy(xr_drop->s.origin, temp);
VectorAdd(xr_drop->s.origin, knifeOffset, xr_drop->s.origin);
}
//Elder: transfer entity data into the shared entityState
//They are rotated on the client side in cg_ents.c
//G_Printf("movedir: %s\n", vtos(ent->s.pos.trDelta));
xr_drop->s.eFlags = xr_drop->flags;
@ -521,7 +521,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
// splash damage (doesn't apply to person directly hit)
if ( ent->splashDamage ) {
if( G_RadiusDamage( trace->endpos, ent->parent, ent->splashDamage, ent->splashRadius,
if( G_RadiusDamage( trace->endpos, ent->parent, ent->splashDamage, ent->splashRadius,
other, ent->splashMethodOfDeath ) ) {
if( !hitClient ) {
g_entities[ent->r.ownerNum].client->accuracy_hits++;
@ -639,7 +639,7 @@ void G_RunMissile( gentity_t *ent ) {
{
vec3_t knifeVelocity;
BG_EvaluateTrajectoryDelta(&ent->s.pos, level.time, knifeVelocity);
BG_EvaluateTrajectoryDelta(&ent->s.pos, level.time, knifeVelocity);
vectoangles(knifeVelocity, ent->s.angles);
ent->s.angles[0] += level.time % 360;
}
@ -701,7 +701,7 @@ gentity_t *fire_plasma (gentity_t *self, vec3_t start, vec3_t dir) {
VectorCopy (start, bolt->r.currentOrigin);
return bolt;
}
}
*/
//=============================================================================
@ -717,7 +717,7 @@ gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) {
vec3_t up, right;
if (self->client)
AngleVectors( self->client->ps.viewangles, NULL, right, up);
AngleVectors( self->client->ps.viewangles, NULL, right, up);
else
{
// just in case we put those shooters back
@ -748,7 +748,7 @@ gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) {
bolt->s.pos.trType = TR_GRAVITY;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
//Elder: grenade toggle distances/speeds
if ( self->client) {
// Elder: Statistics tracking
@ -778,12 +778,12 @@ gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) {
speed = GRENADE_MEDIUM_SPEED;
}
}
VectorScale( dir, speed, bolt->s.pos.trDelta );
VectorMA (bolt->s.pos.trDelta, 200 + crandom() * 10.0f, up, bolt->s.pos.trDelta);
VectorMA (bolt->s.pos.trDelta, crandom() * 10.0f, right, bolt->s.pos.trDelta);
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy (start, bolt->r.currentOrigin);
@ -828,6 +828,9 @@ gentity_t *fire_knife (gentity_t *self, vec3_t start, vec3_t dir)
// Elder: Statistics tracking
self->client->pers.records[REC_KNIFETHROWSHOTS]++;
}
bolt->s.pos.trDelta[2] *= .85;
//Elder: not needed anymore
//Saving stuff for Makro's knife equations
//VectorCopy( start, bolt->s.origin2);
@ -1008,7 +1011,7 @@ gentity_t *fire_nail( gentity_t *self, vec3_t start, vec3_t forward, vec3_t righ
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
}
/*

View File

@ -1,6 +1,6 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
// g_weapon.c
// g_weapon.c
// perform the server side effects of a weapon firing
#include "g_local.h"
@ -51,7 +51,7 @@ qboolean JumpKick( gentity_t *ent )
int damage;
//Elder: for kick sound
qboolean kickSuccess;
// set aiming directions
AngleVectors (ent->client->ps.viewangles, forward, right, up);
CalcMuzzlePoint ( ent, forward, right, up, muzzle );
@ -59,11 +59,11 @@ qboolean JumpKick( gentity_t *ent )
muzzle[2] -= (ent->client->ps.viewheight - 20);
VectorMA (muzzle, 25, forward, end);
//VectorMA (muzzle, 32, forward, end);
//VectorCopy( ent->s.origin, muzzle );
//muzzle[2] += 32;
// the muzzle really isn't the right point to test the jumpkick from
trap_Trace (&tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT);
//trap_Trace (&tr, ent->s.origin, NULL, NULL, end, ent->s.number, MASK_SHOT);
@ -120,7 +120,7 @@ qboolean JumpKick( gentity_t *ent )
tent->s.otherEntityNum2 = ent->s.number;
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.weapon = 0;
if (traceEnt->client->uniqueWeapons > 0)
{
@ -134,7 +134,7 @@ qboolean JumpKick( gentity_t *ent )
//Set the entity's weapon to the target's weapon before he/she throws it
tent->s.weapon = ThrowWeapon(traceEnt, qtrue);
}
// Don't need other sound event
kickSuccess = qfalse;
}
@ -160,7 +160,7 @@ qboolean JumpKick( gentity_t *ent )
//Make the "size" vector - hopefully this is right
//VectorSubtract(traceEnt->r.maxs, traceEnt->r.mins, size);
//G_Printf("Size: %s\n", vtos(size));
//VectorMA(traceEnt->r.absmin, 0.5, size, vTemp);
//VectorSubtract(vTemp, tr.endpos, vTemp);
//VectorNormalize(vTemp);
@ -199,7 +199,7 @@ qboolean DoorKick( trace_t *trIn, gentity_t *ent, vec3_t origin, vec3_t forward
crossProduct = d_forward[0]*d_right[1]-d_right[0]*d_forward[1];
// See if we are on the proper side to do it
if ( ((traceEnt->pos2[1] > traceEnt->pos1[1]) && crossProduct > 0) ||
if ( ((traceEnt->pos2[1] > traceEnt->pos1[1]) && crossProduct > 0) ||
((traceEnt->pos2[1] < traceEnt->pos1[1]) && crossProduct < 0))
{
Cmd_OpenDoor( ent );
@ -306,7 +306,7 @@ SnapVectorTowards
Round a vector to integers for more efficient network
transmission, but make sure that it rounds towards a given point
rather than blindly truncating. This prevents it from truncating
rather than blindly truncating. This prevents it from truncating
into a wall.
======================
*/
@ -394,6 +394,7 @@ void Bullet_Fire (gentity_t *ent, float spread, int damage, int MOD ) {
//r = cos(r) * crandom() * spread * 16;
//FYI: multiply by 16 so we can reach the furthest ends of a "TA" sized map
u = crandom() * spread * 16;
r = crandom() * spread * 16;
VectorMA (muzzle, 8192*16, forward, end);
@ -404,26 +405,33 @@ void Bullet_Fire (gentity_t *ent, float spread, int damage, int MOD ) {
for (i = 0; i < 10; i++) {
trap_Trace (&tr, muzzle, NULL, NULL, end, passent, MASK_SHOT);
if ( tr.surfaceFlags & SURF_NOIMPACT ) {
return;
}
traceEnt = &g_entities[ tr.entityNum ];
// snap the endpos to integers, but nudged towards the line
SnapVectorTowards( tr.endpos, muzzle );
// send bullet impact
if ( traceEnt->takedamage && traceEnt->client ) {
if (bg_itemlist[traceEnt->client->ps.stats[STAT_HOLDABLE_ITEM]].giTag != HI_KEVLAR)
{
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_FLESH );
//tent->s.eventParm = traceEnt->s.number;
tent->s.eventParm = DirToByte(forward);
tent->s.otherEntityNum2 = traceEnt->s.number;
tent->s.otherEntityNum = ent->s.number;
if ( tr.surfaceFlags & SURF_NOIMPACT ) {
return;
}
if( LogAccuracyHit( traceEnt, ent ) ) {
traceEnt = &g_entities[ tr.entityNum ];
// snap the endpos to integers, but nudged towards the line
SnapVectorTowards( tr.endpos, muzzle );
// send bullet impact
// NiceAss: Special hit-detection stuff for the head
if ( traceEnt->takedamage && traceEnt->client && G_HitPlayer(traceEnt, forward, tr.endpos) == qfalse ) {
VectorCopy (tr.endpos, muzzle);
passent = tr.entityNum;
continue;
}
if ( traceEnt->takedamage && traceEnt->client ) {
if (bg_itemlist[traceEnt->client->ps.stats[STAT_HOLDABLE_ITEM]].giTag != HI_KEVLAR)
{
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_FLESH );
//tent->s.eventParm = traceEnt->s.number;
tent->s.eventParm = DirToByte(forward);
tent->s.otherEntityNum2 = traceEnt->s.number;
tent->s.otherEntityNum = ent->s.number;
}
if( LogAccuracyHit( traceEnt, ent ) ) {
ent->client->accuracy_hits++;
// Elder: Statistics tracking
switch (MOD)
@ -446,29 +454,29 @@ void Bullet_Fire (gentity_t *ent, float spread, int damage, int MOD ) {
break;
}
}
//Elder: *******************TEST CODE *****************
//} else if ( tr.surfaceFlags & SURF_GRASS ) {
//tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_FLESH);
//tent->s.eventParm = DirToByte( tr.plane.normal );
} else if ( (tr.surfaceFlags & SURF_METALSTEPS) ||
(tr.surfaceFlags & SURF_METAL2) ) {
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_METAL );
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.otherEntityNum = ent->s.number;
} else if ( tr.surfaceFlags & SURF_GLASS) {
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_GLASS );
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.otherEntityNum = ent->s.number;
} else {
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_WALL );
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.otherEntityNum = ent->s.number;
}
//Elder: *******************TEST CODE *****************
//} else if ( tr.surfaceFlags & SURF_GRASS ) {
//tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_FLESH);
//tent->s.eventParm = DirToByte( tr.plane.normal );
} else if ( (tr.surfaceFlags & SURF_METALSTEPS) ||
(tr.surfaceFlags & SURF_METAL2) ) {
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_METAL );
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.otherEntityNum = ent->s.number;
} else if ( tr.surfaceFlags & SURF_GLASS) {
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_GLASS );
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.otherEntityNum = ent->s.number;
} else {
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_WALL );
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.otherEntityNum = ent->s.number;
}
//tent->s.otherEntityNum = ent->s.number;
//G_Printf("Surfaceflags: %d\n", tr.surfaceFlags);
//tent->s.otherEntityNum = ent->s.number;
//G_Printf("Surfaceflags: %d\n", tr.surfaceFlags);
if ( traceEnt->takedamage) {
if ( traceEnt->takedamage) {
#ifdef MISSIONPACK
if ( traceEnt->client && traceEnt->client->invulnerabilityTime > level.time ) {
if (G_InvulnerabilityEffect( traceEnt, forward, tr.endpos, impactpoint, bouncedir )) {
@ -483,30 +491,29 @@ void Bullet_Fire (gentity_t *ent, float spread, int damage, int MOD ) {
}
continue;
}
else {
else {
#endif
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
damage, 0, MOD);
// FIXME: poor implementation
if (traceEnt->client && bg_itemlist[traceEnt->client->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_KEVLAR) {
if (traceEnt->client->kevlarHit == qfalse) {
tent2 = G_TempEntity( tr.endpos, EV_BULLET_HIT_FLESH );
//tent->s.eventParm = traceEnt->s.number;
tent2->s.eventParm = DirToByte(forward);
tent2->s.otherEntityNum2 = traceEnt->s.number;
// Need this?
tent2->s.otherEntityNum = ent->s.number;
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD);
// FIXME: poor implementation
if (traceEnt->client && bg_itemlist[traceEnt->client->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_KEVLAR) {
if (traceEnt->client->kevlarHit == qfalse) {
tent2 = G_TempEntity( tr.endpos, EV_BULLET_HIT_FLESH );
//tent->s.eventParm = traceEnt->s.number;
tent2->s.eventParm = DirToByte(forward);
tent2->s.otherEntityNum2 = traceEnt->s.number;
// Need this?
tent2->s.otherEntityNum = ent->s.number;
}
else
traceEnt->client->kevlarHit = qfalse;
}
else
traceEnt->client->kevlarHit = qfalse;
}
#ifdef MISSIONPACK
}
}
#endif
}
break;
break;
}
}
@ -555,28 +562,29 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
passent = ent->s.number;
VectorCopy( start, tr_start );
VectorCopy( end, tr_end );
for (i = 0; i < 10; i++) {
trap_Trace (&tr, tr_start, NULL, NULL, tr_end, passent, MASK_SHOT);
traceEnt = &g_entities[ tr.entityNum ];
traceEnt = &g_entities[ tr.entityNum ];
// send bullet impact
if ( tr.surfaceFlags & SURF_NOIMPACT ) {
return qfalse;
}
// send bullet impact
if ( tr.surfaceFlags & SURF_NOIMPACT ) {
return qfalse;
}
if ( traceEnt->takedamage) {
//Elder: added to discern handcannon and m3 damage
if (ent->client && ent->client->ps.weapon == WP_HANDCANNON ) {
//G_Printf("Firing handcannon\n");
damage = HANDCANNON_DAMAGE;
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_HANDCANNON);
}
else {
//G_Printf("Firing M3\n");
damage = M3_DAMAGE;
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_M3);
}
//damage = DEFAULT_SHOTGUN_DAMAGE; // * s_quadFactor;
if ( traceEnt->takedamage) {
//Elder: added to discern handcannon and m3 damage
if (ent->client && ent->client->ps.weapon == WP_HANDCANNON ) {
//G_Printf("Firing handcannon\n");
damage = HANDCANNON_DAMAGE;
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_HANDCANNON);
}
else {
//G_Printf("Firing M3\n");
damage = M3_DAMAGE;
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_M3);
}
//damage = DEFAULT_SHOTGUN_DAMAGE; // * s_quadFactor;
#ifdef MISSIONPACK
if ( traceEnt->client && traceEnt->client->invulnerabilityTime > level.time ) {
if (G_InvulnerabilityEffect( traceEnt, forward, tr.endpos, impactpoint, bouncedir )) {
@ -592,18 +600,18 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
continue;
}
else {
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
damage, 0, MOD_SHOTGUN);
if( LogAccuracyHit( traceEnt, ent ) ) {
return qtrue;
}
}
#else
//Elder: moved into if conditional above
//G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
damage, 0, MOD_SHOTGUN);
if( LogAccuracyHit( traceEnt, ent ) ) {
return qtrue;
}
}
#else
//Elder: moved into if conditional above
//G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
if( LogAccuracyHit( traceEnt, ent ) ) {
return qtrue;
}
#endif
}
return qfalse;
@ -953,7 +961,7 @@ void Weapon_HookThink (gentity_t *ent)
VectorCopy( ent->r.currentOrigin, ent->parent->client->ps.grapplePoint);
}
*/
/*
======================================================================
@ -1098,26 +1106,26 @@ KNIFE ATTACKS
//Elder: changed to void function
void Knife_Attack ( gentity_t *self, int damage)
{
trace_t tr;
{
trace_t tr;
vec3_t end;
gentity_t *hitent;
gentity_t *tent;
if (self->client)
self->client->pers.records[REC_KNIFESLASHSHOTS]++;
VectorMA( muzzle, KNIFE_RANGE, forward, end );
trap_Trace (&tr, muzzle, NULL, NULL, end, self->s.number, MASK_SHOT);
hitent = &g_entities[ tr.entityNum ];
hitent = &g_entities[ tr.entityNum ];
// don't need to check for water
//if (!((tr.surfaceFlags) && (tr.surfaceFlags & SURF_SKY)))
if (!(tr.surfaceFlags & SURF_SKY))
//if (!((tr.surfaceFlags) && (tr.surfaceFlags & SURF_SKY)))
if (!(tr.surfaceFlags & SURF_SKY))
{
if (tr.fraction < 1.0)
{
if (hitent->takedamage)
if (tr.fraction < 1.0)
{
if (hitent->takedamage)
{
//Elder: no knock-back on knife slashes
G_Damage (hitent, self, self, forward, tr.endpos, damage, DAMAGE_NO_KNOCKBACK, MOD_KNIFE );
@ -1138,7 +1146,7 @@ void Knife_Attack ( gentity_t *self, int damage)
}
}
}
}
}
//static int knives = 0;
@ -1152,10 +1160,10 @@ void Knife_Touch (gentity_t *ent, gentity_t *other,trace_t *trace)
G_Printf("Knife Touched Something\n");
if (other == ent->parent)
return;
if (trace && (trace->surfaceFlags & SURF_SKY)) {
//Blaze: Get rid of the knife if it hits the sky
// G_FreeEdict (ent);
@ -1163,17 +1171,17 @@ void Knife_Touch (gentity_t *ent, gentity_t *other,trace_t *trace)
G_FreeEntity(ent);
return;
}
if (ent->parent->client) {
//Blaze: Play the clank hit noise
// gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/clank.wav"), 1, ATTN_NORM, 0);
// PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);
}
// calculate position for the explosion entity
VectorMA (ent->s.origin, -0.02, ent->s.origin2, origin);
//glass fx
if (0 == Q_stricmp(other->classname, "func_explosive")) {
// ignore it, so it can bounce
@ -1185,28 +1193,28 @@ void Knife_Touch (gentity_t *ent, gentity_t *other,trace_t *trace)
G_Damage (other, ent, ent, ent->s.origin2, ent->s.origin, THROW_DAMAGE, 0, MOD_KNIFE_THROWN);
}
else {
// code to manage excess knives in the game, guarantees that
// no more than knifelimit knives will be stuck in walls.
// no more than knifelimit knives will be stuck in walls.
// if knifelimit == 0 then it won't be in effect and it can
// start removing knives even when less than the limit are
// out there.
/* if ( g_rxn_knifelimit.value != 0 )
{
knives++;
if (knives > g_rxn_knifelimit.value)
knives = 1;
knife = FindEdictByClassnum ("weapon_Knife", knives);
if (knife)
{
{
knife->nextthink = level.time + .1;
}
} */
} */
//spawn a knife in the object
//Elder: todo - rotate the knife model so it's collinear with trajectory
//and eliminate the jittering
@ -1278,11 +1286,11 @@ int RQ3_Spread (gentity_t *ent, int spread)
// 225 is running
// < 10 will be standing
float xyspeed = (ent->velocity[0]*ent->velocity[0] + ent->velocity[1]*ent->velocity[1]);
if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) // crouching
return( spread * .65);
if ( (ent->client->pers.inventory[ITEM_INDEX(FindItem(LASER_NAME))])
if ( (ent->client->pers.inventory[ITEM_INDEX(FindItem(LASER_NAME))])
&& (ent->client->curr_weap == MK23_NUM
|| ent->client->curr_weap == MP5_NUM
|| ent->client->curr_weap == M4_NUM ) )
@ -1298,7 +1306,7 @@ int RQ3_Spread (gentity_t *ent, int spread)
// standing
else
stage = 1;
// laser advantage
if (laser)
{
@ -1307,7 +1315,7 @@ int RQ3_Spread (gentity_t *ent, int spread)
else
stage = 1;
}
return (int)(spread * factor[stage]);
*/
@ -1332,7 +1340,7 @@ void Weapon_Knife_Fire(gentity_t *ent)
// extra vertical velocity
forward[2] += 0.2f;
//Elder: already done in Knife_Throw
//VectorNormalize( forward );
@ -1370,7 +1378,7 @@ void Weapon_M4_Fire(gentity_t *ent)
Bullet_Fire( ent, RQ3_Spread(ent, M4_SPREAD), M4_DAMAGE, MOD_M4);
/*
/*
if ( (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_M4MODE) == RQ3_M4MODE) {
//Elder: burst three shots
if (ent->client->weaponfireNextTime > 0 && ent->client->ps.stats[STAT_BURST] > 2) {
@ -1510,13 +1518,23 @@ void Weapon_SSG3000_Fire (gentity_t *ent) {
//G_Printf("(%d) SSG: OOB Entity: exiting loop\n", level.time);
break;
}
traceEnt = &g_entities[ trace.entityNum ];
// NiceAss: Special hit-detection stuff for the head
if ( traceEnt->takedamage && traceEnt->client && G_HitPlayer(traceEnt, forward, trace.endpos) == qfalse ) {
// It actually didn't hit anything...
trap_UnlinkEntity( traceEnt );
unlinkedEntities[unlinked] = traceEnt;
unlinked++;
continue;
}
if ( traceEnt->takedamage )
{
//G_Printf("(%d) SSG: hit damagable entity\n", level.time);
//flag hitBreakable - bullets go through even
//if it doesn't "shatter" - but that's usually
//not the case
@ -1545,7 +1563,7 @@ void Weapon_SSG3000_Fire (gentity_t *ent) {
else
{
// impact type
if ( (trace.surfaceFlags & SURF_METALSTEPS) ||
if ( (trace.surfaceFlags & SURF_METALSTEPS) ||
(trace.surfaceFlags & SURF_METAL2) )
tent[unlinked] = G_TempEntity( trace.endpos, EV_BULLET_HIT_METAL );
else if (trace.surfaceFlags & SURF_GLASS)
@ -1575,7 +1593,7 @@ void Weapon_SSG3000_Fire (gentity_t *ent) {
}
*/
}
//Elder: go through non-solids and breakables
//If we ever wanted to "shoot through walls" we'd do stuff here
if ( hitKevlar || (hitBreakable == qfalse && (trace.contents & CONTENTS_SOLID))) {
@ -1608,7 +1626,7 @@ void Weapon_SSG3000_Fire (gentity_t *ent) {
// no explosion at end if SURF_NOIMPACT
if ( !(trace.surfaceFlags & SURF_NOIMPACT) )
{
if ( (trace.surfaceFlags & SURF_METALSTEPS) ||
if ( (trace.surfaceFlags & SURF_METALSTEPS) ||
(trace.surfaceFlags & SURF_METAL2) )
tentWall = G_TempEntity( trace.endpos, EV_BULLET_HIT_METAL );
else if (trace.surfaceFlags & SURF_GLASS)
@ -1688,7 +1706,7 @@ void Weapon_MP5_Fire(gentity_t *ent)
{
spread = MP5_SPREAD;
}
Bullet_Fire( ent, RQ3_Spread(ent, MP5_SPREAD), MP5_DAMAGE, MOD_MP5);
}
@ -1746,7 +1764,7 @@ void Weapon_M3_Fire(gentity_t *ent)
tent->s.otherEntityNum = ent->s.number;
ShotgunPattern( tent->s.pos.trBase, tent->s.origin2, tent->s.eventParm, ent, WP_M3 );
//Elder: added for damage report
RQ3_ProduceShotgunDamageReport(ent);
}
@ -1764,7 +1782,7 @@ Modelled after the one done for AQ2
void RQ3_InitShotgunDamageReport( void )
{
//Elder: Reset all tookShellHit 'slots' to zero
memset(tookShellHit, 0, MAX_CLIENTS * sizeof(int));
memset(tookShellHit, 0, MAX_CLIENTS * sizeof(int));
}
//Elder: similar to AQ2 source
@ -1778,7 +1796,7 @@ void RQ3_ProduceShotgunDamageReport(gentity_t *self)
gclient_t *hitClient;
//for (l = 1; l <= g_maxclients.integer; l++)
// Run through array to see if anyone was hit
for (i = 0; i < MAX_CLIENTS; i++)
{
@ -1800,7 +1818,7 @@ void RQ3_ProduceShotgunDamageReport(gentity_t *self)
{
//grammar set
if (printed == (totalNames - 1))
{
{
if (totalNames == 2)
Q_strcat(textbuf, sizeof(textbuf), "^7 and ");
else if (totalNames != 1)
@ -1808,7 +1826,7 @@ void RQ3_ProduceShotgunDamageReport(gentity_t *self)
}
else if (printed)
Q_strcat(textbuf, sizeof(textbuf), "^7, ");
//add to text buffer
hitClient = g_entities[i].client;
Q_strcat(textbuf, sizeof(textbuf), hitClient->pers.netname);
@ -1947,7 +1965,7 @@ void FireWeapon( gentity_t *ent ) {
} else {*/
//Elder: uncommented so it won't be zero!
s_quadFactor = 1;
//}
//}
#ifdef MISSIONPACK
if( ent->client->persistantPowerup && ent->client->persistantPowerup->item && ent->client->persistantPowerup->item->giTag == PW_DOUBLER ) {
s_quadFactor *= 2;
@ -2297,7 +2315,7 @@ void Laser_Gen( gentity_t *ent, qboolean enabled ) {
int type = 1;
// First, if it's not the right weapon, leave
if ( ent->client->ps.weapon != WP_PISTOL &&
if ( ent->client->ps.weapon != WP_PISTOL &&
ent->client->ps.weapon != WP_MP5 &&
ent->client->ps.weapon != WP_M4 )
{
@ -2348,6 +2366,8 @@ void Laser_Think( gentity_t *self )
{
vec3_t end, start, forward, up;
trace_t tr;
int l=0, passent;
gentity_t *traceEnt;
//If the player dies, is spectator, or wrong weapon, kill the dot
if (self->parent->client->ps.pm_type == PM_DEAD ||
@ -2365,21 +2385,37 @@ void Laser_Think( gentity_t *self )
//Set Aiming Directions
AngleVectors(self->parent->client->ps.viewangles, forward, right, up);
CalcMuzzlePoint(self->parent, forward, right, up, start);
VectorMA (start, 8192 * 16, forward, end);
//Trace Position
trap_Trace (&tr, start, NULL, NULL, end, self->parent->s.number, MASK_SHOT );
passent = self->parent->s.number;
// Keep tracing if it hits glass.
for (l = 0; l < 10; l++)
{
VectorMA (start, 8192 * 16, forward, end);
//Did you not hit anything?
if (tr.surfaceFlags & SURF_NOIMPACT || tr.surfaceFlags & SURF_SKY) {
self->nextthink = level.time + 10;
trap_UnlinkEntity(self);
return;
//Trace Position
trap_Trace (&tr, start, NULL, NULL, end, passent, MASK_SHOT);
traceEnt = &g_entities[ tr.entityNum ];
//Did you not hit anything?
if (tr.surfaceFlags & SURF_NOIMPACT || tr.surfaceFlags & SURF_SKY) {
self->nextthink = level.time + 10;
trap_UnlinkEntity(self);
return;
}
VectorMA(tr.endpos, 10, forward, start); // Nudge it forward a little bit
// It "hit" a player, but actually missed (thanks to new headshot code!)
if ( traceEnt->takedamage && traceEnt->client && G_HitPlayer(traceEnt, forward, tr.endpos) == qfalse ) {
passent = tr.entityNum;
continue;
}
if (!(tr.surfaceFlags & SURF_GLASS)) break;
}
//Move you forward to keep you visible
if (tr.fraction != 1)
VectorMA(tr.endpos,-4,forward,tr.endpos);
VectorMA(tr.endpos,-4,forward,tr.endpos);
//Set Your position
VectorCopy( tr.endpos, self->r.currentOrigin );
@ -2410,7 +2446,7 @@ void ReloadWeapon ( gentity_t *ent, int stage )
{
//G_Printf("Hit server-side reload stage 1\n");
if ( ent->client->ps.weapon == WP_M3 )
ent->client->numClips[WP_HANDCANNON] = ent->client->numClips[WP_M3];
ent->client->numClips[WP_HANDCANNON] = ent->client->numClips[WP_M3];
ent->client->numClips[ent->client->ps.weapon]--;
}
else if (stage == 2)
@ -2424,15 +2460,15 @@ void ReloadWeapon ( gentity_t *ent, int stage )
//Elder: sync hc and m3 ammo + mk23 and akimbo ammo - a switch might look nicer
if (ent->client->ps.weapon == WP_M3) {
ent->client->numClips[WP_HANDCANNON] = ent->client->numClips[WP_M3];
ent->client->numClips[WP_HANDCANNON] = ent->client->numClips[WP_M3];
}
else if (ent->client->ps.weapon == WP_HANDCANNON) {
else if (ent->client->ps.weapon == WP_HANDCANNON) {
ent->client->numClips[WP_M3] = ent->client->numClips[WP_HANDCANNON];
}
else if(ent->client->ps.weapon == WP_PISTOL) {
ent->client->numClips[WP_AKIMBO] = ent->client->numClips[WP_PISTOL];
ent->client->numClips[WP_AKIMBO] = ent->client->numClips[WP_PISTOL];
}
else if (ent->client->ps.weapon == WP_AKIMBO) {
else if (ent->client->ps.weapon == WP_AKIMBO) {
ent->client->numClips[WP_PISTOL] = ent->client->numClips[WP_AKIMBO];
}
}

View File

@ -14,19 +14,20 @@ void CheckBleeding(gentity_t *targ)
// just safety check it
if (realBleedTime <= 0)
realBleedTime = BLEED_TIME;
if (!(targ->client->bleeding) || (targ->health <=0))
return;
temp = (int)(targ->client->bleeding * 0.2f);
targ->client->bleeding -= temp;
if (temp <= 0)
temp = 1;
targ->client->bleed_remain += temp;
if (!(targ->client->bleeding) || (targ->health <=0))
return;
// NiceAss: (10.0f / realBleedTime) is just (Q2 FPS / Q3 FPS)
temp = (int)(targ->client->bleeding * 0.2f * (10.0f / realBleedTime));
targ->client->bleeding -= temp;
if (temp <= 0)
temp = 1;
targ->client->bleed_remain += temp;
damage = (int)(targ->client->bleed_remain/realBleedTime);
if (targ->client->bleed_remain >= realBleedTime)
{
//G_Printf("Bleed Remain: %i Server Time: %i\n", targ->client->bleed_remain, level.time);
@ -62,12 +63,12 @@ void CheckBleeding(gentity_t *targ)
if (g_RQ3_ejectBlood.integer && targ->client->bleed_delay <= level.time)
{
vec3_t bleedOrigin;
targ->client->bleed_delay = level.time + 2000; // 2 seconds
VectorAdd(targ->client->bleedloc_offset, targ->client->ps.origin, bleedOrigin);
//gi.cprintf(ent, PRINT_HIGH, "Bleeding now.\n");
//EjectBlooder(ent, pos, pos);
// do bleeding
tent = G_TempEntity(bleedOrigin, EV_EJECTBLOOD);
tent->s.otherEntityNum = targ->s.clientNum;
@ -89,7 +90,7 @@ void StartBandage(gentity_t *ent)
{
return;
}
temp = (int)(ent->client->bleeding * .2);
ent->client->bleeding -= temp;
if ( temp <= 0 )
@ -102,7 +103,7 @@ void StartBandage(gentity_t *ent)
if ( damage > 1 )
{
// action doens't do this
//ent->client->damage_blood += damage; // for feedback
//ent->client->damage_blood += damage; // for feedback
}
if ( ent->health <= 0 )
{
@ -121,10 +122,10 @@ void StartBandage(gentity_t *ent)
VectorAdd(ent->client->bleedloc_offset, ent->absmax, pos);
//gi.cprintf(ent, PRINT_HIGH, "Bleeding now.\n");
EjectBlooder(ent, pos, pos);
// do bleeding
}
}
*/
*/

View File

@ -444,7 +444,7 @@ static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
// draw the colored text
trap_R_SetColor( color );
ax = x * uis.scale + uis.bias;
ay = y * uis.scale;
@ -554,7 +554,7 @@ static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t co
// draw the colored text
trap_R_SetColor( color );
ax = x * uis.scale + uis.bias;
ay = y * uis.scale;
@ -681,7 +681,7 @@ static void UI_DrawString2( int x, int y, const char* str, vec4_t color, int cha
// draw the colored text
trap_R_SetColor( color );
ax = x * uis.scale + uis.bias;
ay = y * uis.scale;
aw = charw * uis.scale;
@ -757,13 +757,13 @@ void UI_DrawString( int x, int y, const char* str, int style, vec4_t color )
if (style & UI_PULSE)
{
lowlight[0] = 0.8*color[0];
lowlight[0] = 0.8*color[0];
lowlight[1] = 0.8*color[1];
lowlight[2] = 0.8*color[2];
lowlight[3] = 0.8*color[3];
UI_LerpColor(color,lowlight,newcolor,0.5+0.5*sin(uis.realtime/PULSE_DIVISOR));
drawcolor = newcolor;
}
}
else
drawcolor = color;
@ -838,7 +838,6 @@ void UI_SetActiveMenu( uiMenuCommand_t menu ) {
// this should be the ONLY way the menu system is brought up
// enusure minumum menu data is cached
Menu_Cache();
switch ( menu ) {
case UIMENU_NONE:
UI_ForceMenuOff();
@ -861,7 +860,7 @@ void UI_SetActiveMenu( uiMenuCommand_t menu ) {
trap_Cvar_Set( "cl_paused", "1" );
UI_InGameMenu();
return;
// bk001204
case UIMENU_TEAM:
case UIMENU_POSTGAME:
@ -954,7 +953,7 @@ void UI_MouseEvent( int dx, int dy )
((menucommon_s*)(uis.activemenu->items[uis.activemenu->cursor]))->flags |= QMF_HASMOUSEFOCUS;
return;
}
}
if (uis.activemenu->nitems > 0) {
// out of any region
@ -1164,7 +1163,7 @@ void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader ) {
t0 = 0;
t1 = 1;
}
UI_AdjustFrom640( &x, &y, &w, &h );
trap_R_DrawStretchPic( x, y, w, h, s0, t0, s1, t1, hShader );
}

View File

@ -12,7 +12,7 @@ CONTROLS MENU
#include "ui_local.h"
#define ART_BACK0 "menu/art/rq3-menu-back.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
#define ART_BACK1 "menu/art/rq3-menu-back-focus.tga"
//#define ART_BACK0 "menu/art/back_0"
//#define ART_BACK1 "menu/art/back_1"
//#define ART_FRAMEL "menu/art/frame2_l"
@ -44,7 +44,7 @@ typedef struct
{
char* name;
float defaultvalue;
float value;
float value;
} configcvar_t;
#define SAVE_NOOP 0
@ -75,32 +75,32 @@ typedef struct
// bindable actions
#define ID_SHOWSCORES 0
#define ID_USEITEM 1
#define ID_SPEED 2
#define ID_FORWARD 3
#define ID_USEITEM 1
#define ID_SPEED 2
#define ID_FORWARD 3
#define ID_BACKPEDAL 4
#define ID_MOVELEFT 5
#define ID_MOVERIGHT 6
#define ID_MOVEUP 7
#define ID_MOVEUP 7
#define ID_MOVEDOWN 8
#define ID_LEFT 9
#define ID_RIGHT 10
#define ID_STRAFE 11
#define ID_LOOKUP 12
#define ID_LEFT 9
#define ID_RIGHT 10
#define ID_STRAFE 11
#define ID_LOOKUP 12
#define ID_LOOKDOWN 13
#define ID_MOUSELOOK 14
#define ID_CENTERVIEW 15
#define ID_ZOOMVIEW 16
// Elder: WEAPON1 is now pistol
#define ID_WEAPON1 17
#define ID_WEAPON1 17
#define ID_WEAPON2 18
#define ID_WEAPON3 19
#define ID_WEAPON4 20
#define ID_WEAPON5 21
#define ID_WEAPON6 22
#define ID_WEAPON7 23
#define ID_WEAPON8 24
#define ID_WEAPON9 25
#define ID_WEAPON3 19
#define ID_WEAPON4 20
#define ID_WEAPON5 21
#define ID_WEAPON6 22
#define ID_WEAPON7 23
#define ID_WEAPON8 24
#define ID_WEAPON9 25
#define ID_ATTACK 26
#define ID_WEAPPREV 27
#define ID_WEAPNEXT 28
@ -182,7 +182,7 @@ typedef struct
menutext_s rq3_statustext;
menubitmap_s player;
/*
menutext_s movement;
menutext_s looking;
@ -193,7 +193,7 @@ typedef struct
menubitmap_s looking;
menubitmap_s weapons;
menubitmap_s misc;
//Blaze: Reaction Menu
menubitmap_s reaction;
@ -207,7 +207,7 @@ typedef struct
menuaction_s turnright;
menuaction_s sidestep;
menuaction_s run;
//Blaze: Dont need these
//menuaction_s chainsaw;
//menuaction_s machinegun;
@ -252,7 +252,7 @@ typedef struct
menuaction_s dropweap;
menuaction_s dropitem;
menuaction_s irvision;
menuradiobutton_s joyenable;
menuslider_s joythreshold;
int section;
@ -267,13 +267,13 @@ typedef struct
menubitmap_s back;
menutext_s name;
} controls_t;
} controls_t;
static controls_t s_controls;
static vec4_t controls_binding_color = {1.00f, 0.43f, 0.00f, 1.00f}; // bk: Win32 C4305
static bind_t g_bindings[] =
static bind_t g_bindings[] =
{
{"+scores", "show scores", ID_SHOWSCORES, ANIM_IDLE, K_TAB, -1, -1, -1},
{"+button2", "use item", ID_USEITEM, ANIM_IDLE, K_ENTER, -1, -1, -1},
@ -317,7 +317,7 @@ static bind_t g_bindings[] =
{"opendoor", "Open Door", ID_OPENDOOR, ANIM_IDLE, -1, -1, -1, -1},
{"dropweapon", "Drop Weapon", ID_DROPWEAP, ANIM_IDLE, -1, -1, -1, -1},
{"dropitem", "Drop Item", ID_DROPITEM, ANIM_IDLE, -1, -1, -1, -1},
{"irvision", "IR Vision", ID_DROPITEM, ANIM_IDLE, -1, -1, -1, -1},
{"irvision", "IR Vision", ID_IRVISION, ANIM_IDLE, -1, -1, -1, -1},
{(char*)NULL, (char*)NULL, 0, 0, -1, -1, -1, -1},
};
@ -336,39 +336,39 @@ static configcvar_t g_configcvars[] =
static menucommon_s *g_movement_controls[] =
{
(menucommon_s *)&s_controls.alwaysrun,
(menucommon_s *)&s_controls.run,
(menucommon_s *)&s_controls.alwaysrun,
(menucommon_s *)&s_controls.run,
(menucommon_s *)&s_controls.walkforward,
(menucommon_s *)&s_controls.backpedal,
(menucommon_s *)&s_controls.stepleft,
(menucommon_s *)&s_controls.stepright,
(menucommon_s *)&s_controls.moveup,
(menucommon_s *)&s_controls.movedown,
(menucommon_s *)&s_controls.turnleft,
(menucommon_s *)&s_controls.turnright,
(menucommon_s *)&s_controls.stepleft,
(menucommon_s *)&s_controls.stepright,
(menucommon_s *)&s_controls.moveup,
(menucommon_s *)&s_controls.movedown,
(menucommon_s *)&s_controls.turnleft,
(menucommon_s *)&s_controls.turnright,
(menucommon_s *)&s_controls.sidestep,
NULL
};
static menucommon_s *g_weapons_controls[] = {
(menucommon_s *)&s_controls.attack,
(menucommon_s *)&s_controls.attack,
(menucommon_s *)&s_controls.nextweapon,
(menucommon_s *)&s_controls.prevweapon,
(menucommon_s *)&s_controls.autoswitch,
(menucommon_s *)&s_controls.autoswitch,
//Blaze: No need for the chainsaw/gauntlet or machinegun
/*
(menucommon_s *)&s_controls.chainsaw,
(menucommon_s *)&s_controls.chainsaw,
(menucommon_s *)&s_controls.machinegun,
*/
(menucommon_s *)&s_controls.mk23,
(menucommon_s *)&s_controls.m3,
(menucommon_s *)&s_controls.mp5,
(menucommon_s *)&s_controls.mp5,
(menucommon_s *)&s_controls.handcannon,
(menucommon_s *)&s_controls.ssg3000,
(menucommon_s *)&s_controls.ssg3000,
(menucommon_s *)&s_controls.m4,
(menucommon_s *)&s_controls.akimbos,
(menucommon_s *)&s_controls.knife,
(menucommon_s *)&s_controls.grenade,
(menucommon_s *)&s_controls.akimbos,
(menucommon_s *)&s_controls.knife,
(menucommon_s *)&s_controls.grenade,
NULL,
};
@ -388,7 +388,7 @@ static menucommon_s *g_looking_controls[] = {
};
static menucommon_s *g_misc_controls[] = {
(menucommon_s *)&s_controls.showscores,
(menucommon_s *)&s_controls.showscores,
(menucommon_s *)&s_controls.useitem,
(menucommon_s *)&s_controls.gesture,
(menucommon_s *)&s_controls.chat,
@ -399,8 +399,8 @@ static menucommon_s *g_misc_controls[] = {
};
//Blaze: Reaction Menu stuff
static menucommon_s *g_reaction_controls[] = {
(menucommon_s *)&s_controls.bandage,
(menucommon_s *)&s_controls.bandage,
(menucommon_s *)&s_controls.reload,
(menucommon_s *)&s_controls.weapon,
(menucommon_s *)&s_controls.opendoor,
@ -513,23 +513,23 @@ static void Controls_UpdateModel( int anim ) {
s_controls.playerChat = qfalse;
switch( anim ) {
case ANIM_RUN:
case ANIM_RUN:
s_controls.playerLegs = LEGS_RUN;
break;
case ANIM_WALK:
case ANIM_WALK:
s_controls.playerLegs = LEGS_WALK;
break;
case ANIM_BACK:
case ANIM_BACK:
s_controls.playerLegs = LEGS_BACK;
break;
case ANIM_JUMP:
case ANIM_JUMP:
s_controls.playerLegs = LEGS_JUMP;
break;
case ANIM_CROUCH:
case ANIM_CROUCH:
s_controls.playerLegs = LEGS_IDLECR;
break;
@ -728,16 +728,16 @@ static void Controls_Update( void ) {
s_controls.movement.generic.flags &= ~QMF_PULSEIFFOCUS;
s_controls.movement.generic.flags |= (QMF_HIGHLIGHT|QMF_HIGHLIGHT_IF_FOCUS);
break;
case C_LOOKING:
s_controls.looking.generic.flags &= ~QMF_PULSEIFFOCUS;
s_controls.looking.generic.flags |= (QMF_HIGHLIGHT|QMF_HIGHLIGHT_IF_FOCUS);
break;
case C_WEAPONS:
s_controls.weapons.generic.flags &= ~QMF_PULSEIFFOCUS;
s_controls.weapons.generic.flags |= (QMF_HIGHLIGHT|QMF_HIGHLIGHT_IF_FOCUS);
break;
break;
case C_MISC:
s_controls.misc.generic.flags &= ~QMF_PULSEIFFOCUS;
@ -796,7 +796,7 @@ static void Controls_DrawKeyBinding( void *self )
if (c)
{
UI_FillRect( a->generic.left, a->generic.top, a->generic.right-a->generic.left+1, a->generic.bottom-a->generic.top+1, listbar_color );
UI_FillRect( a->generic.left, a->generic.top, a->generic.right-a->generic.left+1, a->generic.bottom-a->generic.top+1, listbar_color );
UI_DrawString( x - SMALLCHAR_WIDTH, y, g_bindings[a->generic.id].label, UI_RIGHT|UI_SMALLFONT, text_color_highlight );
UI_DrawString( x + SMALLCHAR_WIDTH, y, name, UI_LEFT|UI_SMALLFONT|UI_PULSE, text_color_highlight );
@ -945,7 +945,7 @@ static void Controls_SetConfig( void )
break;
if (bindptr->bind1 != -1)
{
{
trap_Key_SetBinding( bindptr->bind1, bindptr->command );
if (bindptr->bind2 != -1)
@ -1023,12 +1023,12 @@ static sfxHandle_t Controls_MenuKey( int key )
case K_KP_DEL:
key = -1;
break;
case K_MOUSE2:
case K_ESCAPE:
if (s_controls.changesmade)
Controls_SetConfig();
goto ignorekey;
goto ignorekey;
default:
goto ignorekey;
@ -1045,21 +1045,21 @@ static sfxHandle_t Controls_MenuKey( int key )
s_controls.waitingforkey = qfalse;
Controls_Update();
return (menu_out_sound);
case '`':
goto ignorekey;
}
}
s_controls.changesmade = qtrue;
if (key != -1)
{
// remove from any other bind
bindptr = g_bindings;
for (i=0; ;i++,bindptr++)
{
if (!bindptr->label)
if (!bindptr->label)
break;
if (bindptr->bind2 == key)
@ -1067,7 +1067,7 @@ static sfxHandle_t Controls_MenuKey( int key )
if (bindptr->bind1 == key)
{
bindptr->bind1 = bindptr->bind2;
bindptr->bind1 = bindptr->bind2;
bindptr->bind2 = -1;
}
}
@ -1078,9 +1078,9 @@ static sfxHandle_t Controls_MenuKey( int key )
bindptr = g_bindings;
for (i=0; ;i++,bindptr++)
{
if (!bindptr->label)
if (!bindptr->label)
break;
if (bindptr->id == id)
{
found = qtrue;
@ -1107,15 +1107,15 @@ static sfxHandle_t Controls_MenuKey( int key )
trap_Key_SetBinding( bindptr->bind2, "" );
bindptr->bind1 = key;
bindptr->bind2 = -1;
}
}
break;
}
}
}
s_controls.waitingforkey = qfalse;
if (found)
{
{
Controls_Update();
return (menu_out_sound);
}
@ -1195,7 +1195,7 @@ static void Controls_MenuEvent( void* ptr, int event )
case ID_MOVEMENT:
//if (event == QM_ACTIVATED)
//{
s_controls.section = C_MOVEMENT;
s_controls.section = C_MOVEMENT;
Controls_Update();
//}
break;
@ -1203,7 +1203,7 @@ static void Controls_MenuEvent( void* ptr, int event )
case ID_LOOKING:
//if (event == QM_ACTIVATED)
//{
s_controls.section = C_LOOKING;
s_controls.section = C_LOOKING;
Controls_Update();
//}
break;
@ -1211,7 +1211,7 @@ static void Controls_MenuEvent( void* ptr, int event )
case ID_WEAPONS:
//if (event == QM_ACTIVATED)
//{
s_controls.section = C_WEAPONS;
s_controls.section = C_WEAPONS;
Controls_Update();
//}
break;
@ -1219,7 +1219,7 @@ static void Controls_MenuEvent( void* ptr, int event )
case ID_MISC:
//if (event == QM_ACTIVATED)
//{
s_controls.section = C_MISC;
s_controls.section = C_MISC;
Controls_Update();
//}
break;
@ -1274,7 +1274,7 @@ static void Controls_MenuEvent( void* ptr, int event )
//{
s_controls.changesmade = qtrue;
//}
break;
break;
}
}
}
@ -1344,7 +1344,7 @@ static void Controls_MenuDraw( void ) {
UI_FillRect( 0, 426, SCREEN_WIDTH, 54, color_black);
UI_FillRect( 0, 54, SCREEN_WIDTH, 2, color_red);
UI_FillRect( 0, 426, SCREEN_WIDTH, 2, color_red);
// standard menu drawing
Menu_Draw( &s_controls.menu );
}
@ -1901,7 +1901,7 @@ static void Controls_MenuInit( void )
s_controls.opendoor.generic.callback = Controls_ActionEvent;
s_controls.opendoor.generic.ownerdraw = Controls_DrawKeyBinding;
s_controls.opendoor.generic.id = ID_OPENDOOR;
s_controls.dropweap.generic.type = MTYPE_ACTION;
s_controls.dropweap.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_GRAYED|QMF_HIDDEN;
s_controls.dropweap.generic.callback = Controls_ActionEvent;
@ -2002,7 +2002,7 @@ static void Controls_MenuInit( void )
// Menu_AddItem( &s_controls.menu, &s_controls.chainsaw );
// Menu_AddItem( &s_controls.menu, &s_controls.machinegun );
//Blaze: Reaction weapon additions Pistol replaces machinegun
Menu_AddItem( &s_controls.menu, &s_controls.mk23);
Menu_AddItem( &s_controls.menu, &s_controls.m3);
Menu_AddItem( &s_controls.menu, &s_controls.mp5 );

View File

@ -53,6 +53,9 @@ typedef struct {
menubitmap_s rq3_exitbutton;
menutext_s rq3_statustext;
//Niceass: Cvar Kick text
menutext_s rq3_kicktext;
} mainmenu_t;
@ -72,6 +75,29 @@ static void MainMenu_ExitAction( qboolean result ) {
}
/*
=================
CheckKickCvar - Added by NiceAss to help the newbies out =)
================
*/
void UI_CheckKickCvar( void ) {
static char Reason[256], Cvar[64];
strcpy(Reason, "WARNING: You have been kicked because ");
trap_Cvar_VariableStringBuffer("RQ3_CvarKickReason", Cvar, sizeof(Cvar));
if (strlen(Cvar)) {
Com_Printf("AHAH!: [%s]\n", Cvar);
trap_Cvar_Set("RQ3_CvarKickReason", "");
strcat(Reason, Cvar);
strcat(Reason, " is out of range.");
s_main.rq3_kicktext.string = Reason;
}
else {
s_main.rq3_kicktext.string = "";
}
}
/*
=================
@ -86,27 +112,27 @@ void Main_MenuEvent (void* ptr, int event) {
else if( event == QM_GOTFOCUS ) {
//get menu item id
switch( ((menucommon_s*)ptr)->id ) {
case ID_MULTIPLAYER:
s_main.rq3_statustext.string = "Play Reaction Quake 3";
break;
case ID_SETUP:
s_main.rq3_statustext.string = "Configure Reaction Quake 3";
break;
break;
case ID_DEMOS:
s_main.rq3_statustext.string = "Playback in-game demos";
break;
case ID_MODS:
s_main.rq3_statustext.string = "Change game modification";
break;
case ID_EXIT:
s_main.rq3_statustext.string = "Exit Reaction Quake 3";
break;
default:
s_main.rq3_statustext.string = "";
break;
@ -152,7 +178,7 @@ void Main_MenuEvent (void* ptr, int event) {
case ID_EXIT:
UI_ConfirmMenu( "EXIT REACTION?", NULL, MainMenu_ExitAction );
break;
}
}
else {
@ -169,7 +195,7 @@ MainMenu_Cache
void MainMenu_Cache( void ) {
//Blaze: removed the banner
//s_main.bannerModel = trap_R_RegisterModel( MAIN_BANNER_MODEL );
//Elder: cache button images
trap_R_RegisterShaderNoMip( RQ3_START_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_SETUP_BUTTON );
@ -177,7 +203,7 @@ void MainMenu_Cache( void ) {
trap_R_RegisterShaderNoMip( RQ3_MODS_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_EXIT_BUTTON );
trap_R_RegisterShaderNoMip( RQ3_FOCUS_BUTTON );
}
@ -274,7 +300,7 @@ static qboolean UI_TeamArenaExists( void ) {
int numdirs;
char dirlist[2048];
char *dirptr;
char *descptr;
char *descptr;
int i;
int dirlen;
@ -308,6 +334,8 @@ void UI_MainMenu( void ) {
int y;
qboolean teamArena = qfalse;
int style = UI_CENTER | UI_DROPSHADOW;
// NiceAss: CvarKickReason stuff
char Reason[256], Cvar[64];
trap_Cvar_Set( "sv_killserver", "1" );
@ -323,22 +351,25 @@ void UI_MainMenu( void ) {
memset( &s_main, 0 ,sizeof(mainmenu_t) );
// NiceAss: Check to see if you were kicked.
UI_CheckKickCvar();
MainMenu_Cache();
s_main.menu.draw = Main_MenuDraw;
s_main.menu.fullscreen = qtrue;
s_main.menu.wrapAround = qtrue;
s_main.menu.showlogo = qtrue;
//Blaze: Reaction menu
y = 12;
//Elder: RQ3 Start Button
s_main.rq3_startbutton.generic.type = MTYPE_BITMAP;
s_main.rq3_startbutton.generic.name = RQ3_START_BUTTON;
s_main.rq3_startbutton.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_startbutton.generic.id = ID_MULTIPLAYER;
s_main.rq3_startbutton.generic.callback = Main_MenuEvent;
s_main.rq3_startbutton.generic.callback = Main_MenuEvent;
s_main.rq3_startbutton.generic.x = (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_main.rq3_startbutton.generic.y = y;
s_main.rq3_startbutton.width = RQ3_BUTTON_WIDTH;
@ -350,7 +381,7 @@ void UI_MainMenu( void ) {
s_main.rq3_setupbutton.generic.name = RQ3_SETUP_BUTTON;
s_main.rq3_setupbutton.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_setupbutton.generic.id = ID_SETUP;
s_main.rq3_setupbutton.generic.callback = Main_MenuEvent;
s_main.rq3_setupbutton.generic.callback = Main_MenuEvent;
s_main.rq3_setupbutton.generic.x = (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_main.rq3_setupbutton.generic.y = y;
s_main.rq3_setupbutton.width = RQ3_BUTTON_WIDTH;
@ -362,19 +393,19 @@ void UI_MainMenu( void ) {
s_main.rq3_demosbutton.generic.name = RQ3_DEMOS_BUTTON;
s_main.rq3_demosbutton.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_demosbutton.generic.id = ID_DEMOS;
s_main.rq3_demosbutton.generic.callback = Main_MenuEvent;
s_main.rq3_demosbutton.generic.callback = Main_MenuEvent;
s_main.rq3_demosbutton.generic.x = (RQ3_BUTTON_PADDING + RQ3_BUTTON_WIDTH) * buttonCount++;
s_main.rq3_demosbutton.generic.y = y;
s_main.rq3_demosbutton.width = RQ3_BUTTON_WIDTH;
s_main.rq3_demosbutton.height = RQ3_BUTTON_HEIGHT;
s_main.rq3_demosbutton.focuspic = RQ3_FOCUS_BUTTON;
//Elder: RQ3 Mods Button
s_main.rq3_modsbutton.generic.type = MTYPE_BITMAP;
s_main.rq3_modsbutton.generic.name = RQ3_MODS_BUTTON;
s_main.rq3_modsbutton.generic.flags = QMF_RIGHT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_modsbutton.generic.id = ID_MODS;
s_main.rq3_modsbutton.generic.callback = Main_MenuEvent;
s_main.rq3_modsbutton.generic.callback = Main_MenuEvent;
s_main.rq3_modsbutton.generic.x = 640 - (RQ3_BUTTON_WIDTH + RQ3_BUTTON_PADDING);
s_main.rq3_modsbutton.generic.y = y;
s_main.rq3_modsbutton.width = RQ3_BUTTON_WIDTH;
@ -386,7 +417,7 @@ void UI_MainMenu( void ) {
s_main.rq3_exitbutton.generic.name = RQ3_EXIT_BUTTON;
s_main.rq3_exitbutton.generic.flags = QMF_RIGHT_JUSTIFY|QMF_HIGHLIGHT_IF_FOCUS;
s_main.rq3_exitbutton.generic.id = ID_EXIT;
s_main.rq3_exitbutton.generic.callback = Main_MenuEvent;
s_main.rq3_exitbutton.generic.callback = Main_MenuEvent;
s_main.rq3_exitbutton.generic.x = 640;
s_main.rq3_exitbutton.generic.y = y;
s_main.rq3_exitbutton.width = RQ3_BUTTON_WIDTH;
@ -401,7 +432,15 @@ void UI_MainMenu( void ) {
s_main.rq3_statustext.string = "";
s_main.rq3_statustext.style = UI_CENTER|UI_SMALLFONT;
s_main.rq3_statustext.color = color_orange;
//NiceAss: For RQ3_CvarKickReason
s_main.rq3_kicktext.generic.type = MTYPE_TEXT;
s_main.rq3_kicktext.generic.flags = QMF_CENTER_JUSTIFY;
s_main.rq3_kicktext.generic.x = RQ3_STATUSBAR_X;
s_main.rq3_kicktext.generic.y = RQ3_STATUSBAR_Y + 17;
s_main.rq3_kicktext.style = UI_CENTER|UI_SMALLFONT;
s_main.rq3_kicktext.color = color_yellow;
/*Elder: Replaced by RQ3 buttons above
//Blaze: This menu nolonger exists
s_main.singleplayer.generic.type = MTYPE_PTEXT;
@ -409,7 +448,7 @@ void UI_MainMenu( void ) {
s_main.singleplayer.generic.x = 320;
s_main.singleplayer.generic.y = y+150;
s_main.singleplayer.generic.id = ID_SINGLEPLAYER;
s_main.singleplayer.generic.callback = Main_MenuEvent;
s_main.singleplayer.generic.callback = Main_MenuEvent;
s_main.singleplayer.string = "SINGLE PLAYER";
s_main.singleplayer.color = color_red;
s_main.singleplayer.style = style;
@ -422,11 +461,11 @@ void UI_MainMenu( void ) {
s_main.multiplayer.generic.x = 120;//Blaze: Menu X loc
s_main.multiplayer.generic.y = y;
s_main.multiplayer.generic.id = ID_MULTIPLAYER;
s_main.multiplayer.generic.callback = Main_MenuEvent;
s_main.multiplayer.generic.callback = Main_MenuEvent;
s_main.multiplayer.string = "MULTIPLAYER";
s_main.multiplayer.color = color_red;
s_main.multiplayer.style = style;
//Blaze: Reaction Menu
//y += MAIN_MENU_VERTICAL_SPACING;
s_main.setup.generic.type = MTYPE_PTEXT;
@ -434,7 +473,7 @@ void UI_MainMenu( void ) {
s_main.setup.generic.x = 280;//Blaze: Menu x loc
s_main.setup.generic.y = y;
s_main.setup.generic.id = ID_SETUP;
s_main.setup.generic.callback = Main_MenuEvent;
s_main.setup.generic.callback = Main_MenuEvent;
s_main.setup.string = "SETUP";
s_main.setup.color = color_red;
s_main.setup.style = style;
@ -445,7 +484,7 @@ void UI_MainMenu( void ) {
s_main.demos.generic.x = 390;//Blaze: Menu x loc
s_main.demos.generic.y = y;
s_main.demos.generic.id = ID_DEMOS;
s_main.demos.generic.callback = Main_MenuEvent;
s_main.demos.generic.callback = Main_MenuEvent;
s_main.demos.string = "DEMOS";
s_main.demos.color = color_red;
s_main.demos.style = style;
@ -457,12 +496,12 @@ void UI_MainMenu( void ) {
s_main.cinematics.generic.x = 350;//Blaze: Menu x loc
s_main.cinematics.generic.y = y+150;
s_main.cinematics.generic.id = ID_CINEMATICS;
s_main.cinematics.generic.callback = Main_MenuEvent;
s_main.cinematics.generic.callback = Main_MenuEvent;
s_main.cinematics.string = "CINEMATICS";
s_main.cinematics.color = color_red;
s_main.cinematics.style = style;
//Blaze: This menu nolonger exists
if (UI_TeamArenaExists()) {
teamArena = qtrue;
@ -472,7 +511,7 @@ void UI_MainMenu( void ) {
s_main.teamArena.generic.x = 320;
s_main.teamArena.generic.y = y;
s_main.teamArena.generic.id = ID_TEAMARENA;
s_main.teamArena.generic.callback = Main_MenuEvent;
s_main.teamArena.generic.callback = Main_MenuEvent;
s_main.teamArena.string = "TEAM ARENA";
s_main.teamArena.color = color_red;
s_main.teamArena.style = style;
@ -484,7 +523,7 @@ void UI_MainMenu( void ) {
s_main.mods.generic.x = 500;//Blaze: Menu x loc
s_main.mods.generic.y = y;
s_main.mods.generic.id = ID_MODS;
s_main.mods.generic.callback = Main_MenuEvent;
s_main.mods.generic.callback = Main_MenuEvent;
s_main.mods.string = "MODS";
s_main.mods.color = color_red;
s_main.mods.style = style;
@ -495,7 +534,7 @@ void UI_MainMenu( void ) {
s_main.exit.generic.x = 590;//Blaze: Menu x loc
s_main.exit.generic.y = y;
s_main.exit.generic.id = ID_EXIT;
s_main.exit.generic.callback = Main_MenuEvent;
s_main.exit.generic.callback = Main_MenuEvent;
s_main.exit.string = "EXIT";
s_main.exit.color = color_red;
s_main.exit.style = style;
@ -508,9 +547,10 @@ void UI_MainMenu( void ) {
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_demosbutton );
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_modsbutton );
Menu_AddItem( &s_main.menu, ( void * )&s_main.rq3_exitbutton );
Menu_AddItem( &s_main.menu, &s_main.rq3_statustext );
Menu_AddItem( &s_main.menu, &s_main.rq3_kicktext );
// Start music
trap_Cmd_ExecuteText( EXEC_APPEND, "music music/rq3_title_intro music/rq3_title_loop\n" );
@ -528,7 +568,7 @@ void UI_MainMenu( void ) {
// Menu_AddItem( &s_main.menu, &s_main.teamArena );
//}
//Menu_AddItem( &s_main.menu, &s_main.mods );
//Menu_AddItem( &s_main.menu, &s_main.exit );
//Menu_AddItem( &s_main.menu, &s_main.exit );
trap_Key_SetCatcher( KEYCATCH_UI );
uis.menusp = 0;