Work done at the HPWorld expo

This commit is contained in:
Richard Allen 2002-09-29 16:06:45 +00:00
parent 746bd5be1e
commit 7f50a1b2e0
17 changed files with 440 additions and 685 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.53 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.52 2002/08/29 14:45:17 niceass
// disabled wallhack
//
@ -1009,12 +1012,12 @@ void CG_UpdateTeamVars()
{
clientInfo_t *ci;
int i;
int Reds, Blues, Spectators;
int Reds, Blues, Spectators, Dmers;
//Makro - changed from 2 to 4; not really needed, but it's safer
char v[4];
Reds = Blues = Spectators = 0;
Reds = Blues = Spectators = Dmers = 0;
for (i = 0, ci = cgs.clientinfo; i < cgs.maxclients; i++, ci++) {
if (!ci->infoValid)
@ -1023,16 +1026,32 @@ void CG_UpdateTeamVars()
Reds++;
if (ci->team == TEAM_BLUE)
Blues++;
if (ci->team == TEAM_SPECTATOR || ci->team == TEAM_FREE)
Spectators++;
if (cgs.gametype >= GT_TEAM) {
if (ci->team == TEAM_SPECTATOR || ci->team == TEAM_FREE)
Spectators++;
} else {
if (ci->team == TEAM_FREE)
Dmers++;
if (ci->team == TEAM_SPECTATOR)
Spectators++;
}
}
//CG_Printf("Reds: %i, Blues: %i, Spectators: %i\n",Reds, Blues, Spectators);
Com_sprintf(v, sizeof(v), "%i", Reds);
trap_Cvar_Set("ui_RQ3_teamCount1", v);
Com_sprintf(v, sizeof(v), "%i", Blues);
trap_Cvar_Set("ui_RQ3_teamCount2", v);
Com_sprintf(v, sizeof(v), "%i", Spectators);
trap_Cvar_Set("ui_RQ3_numSpectators", v);
// JBravo: We count the "teams" differently in DM
if (cgs.gametype >= GT_TEAM) {
Com_sprintf(v, sizeof(v), "%i", Reds);
trap_Cvar_Set("ui_RQ3_teamCount1", v);
Com_sprintf(v, sizeof(v), "%i", Blues);
trap_Cvar_Set("ui_RQ3_teamCount2", v);
Com_sprintf(v, sizeof(v), "%i", Spectators);
trap_Cvar_Set("ui_RQ3_numSpectators", v);
} else {
Com_sprintf(v, sizeof(v), "%i", Dmers);
trap_Cvar_Set("ui_RQ3_teamCount1", v);
Com_sprintf(v, sizeof(v), "%i", Spectators);
trap_Cvar_Set("ui_RQ3_numSpectators", v);
}
}
/*

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.67 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.66 2002/09/17 20:17:12 blaze
// Fixed up the cg_rq3_autoaction to include the map name, and removed the player name since it was broken anyways
//
@ -1233,6 +1236,9 @@ void CG_RQ3_Cmd()
CG_Printf("\nCAMERA...\n");
CG_AddBufferedSound(cgs.media.cameraSound);
break;
case TPCOUNTDOWN:
CG_AddBufferedSound(cgs.media.lca10_0Sound);
break;
case ACTION:
CG_CenterPrint("ACTION!", SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH);
CG_Printf("\nACTION!\n");

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.51 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.50 2002/07/22 06:34:46 niceass
// cleaned up the powerup code
//
@ -1660,7 +1663,11 @@ void BotChooseWeapon(bot_state_t * bs)
return;
}
if (bs->cur_ps.weaponstate == WEAPON_RAISING || bs->cur_ps.weaponstate == WEAPON_DROPPING) {
// JBravo: Force the bot to use a pistol when he decides to go for a case.
if (bs->ltgtype == LTG_GETFLAG) {
bs->weaponnum = WP_PISTOL;
RQ3_Bot_ChooseWeaponMode(bs);
} else if (bs->cur_ps.weaponstate == WEAPON_RAISING || bs->cur_ps.weaponstate == WEAPON_DROPPING) {
trap_EA_SelectWeapon(bs->client, bs->weaponnum);
//Makro - choose weapon mode
RQ3_Bot_ChooseWeaponMode(bs);

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.97 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.96 2002/09/01 21:15:08 makro
// Sky portal tweaks
//
@ -360,7 +363,7 @@ enum {
LIGHTS,
CAMERA,
ACTION,
//SETTEAMPLAYERS,
TPCOUNTDOWN,
SELECTPISTOL,
//Slicer: apparently not being used
// ROUND,

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.90 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.89 2002/09/24 05:06:16 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
@ -508,7 +511,7 @@ void SpectatorThink(gentity_t * ent, usercmd_t * ucmd)
}
if (client->sess.spectatorState == SPECTATOR_FREE) {
if (g_gametype.integer == GT_CTF && client->sess.spectatorState == SPECTATOR_FREE &&
if (g_gametype.integer == GT_CTF && level.team_round_going &&
(client->sess.savedTeam == TEAM_RED || client->sess.savedTeam == TEAM_BLUE))
client->ps.pm_type = PM_FREEZE;
else
@ -1220,13 +1223,6 @@ void ClientThink_real(gentity_t * ent)
if ((g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) && level.time > client->respawnTime) {
MakeSpectator(ent);
}
/* if (g_gametype.integer == GT_CTF) {
if (level.time > client->time_of_death + (g_RQ3_ctb_respawndelay.integer * 1000)) {
respawn(ent);
} else {
return;
}
} */
// pressing attack or use is the normal respawn method
// JBravo: make'em spactate
if (ucmd->buttons & (BUTTON_ATTACK | BUTTON_USE_HOLDABLE)) {
@ -1243,7 +1239,7 @@ void ClientThink_real(gentity_t * ent)
if (g_RQ3_ppl_idletime.integer) {
if (ucmd->forwardmove == 0 && ucmd->rightmove == 0) {
if (client->idletime) {
if (level.time >= client->idletime + (g_RQ3_ppl_idletime.integer *1000)) {
if (level.time >= client->idletime + (g_RQ3_ppl_idletime.integer * 1000)) {
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_idleaction.integer == 1 &&
(ent->client->sess.sessionTeam == TEAM_RED || ent->client->sess.sessionTeam == TEAM_BLUE)) {
trap_SendServerCommand( -1, va("print \"Removing %s^7 from his team for excessive Idling\n\"",

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.117 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.116 2002/09/24 05:06:16 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
@ -389,13 +392,11 @@ qboolean SpotWouldTelefrag(gentity_t * spot)
//Blaze: Print out some Debug info
if (&g_entities[touch[i]] == NULL) G_Printf("Ln 0376\n");
hit = &g_entities[touch[i]];
//if ( hit->client && hit->client->ps.stats[STAT_HEALTH] > 0 ) {
if (hit->client) {
return qtrue;
}
}
return qfalse;
}
@ -407,7 +408,7 @@ Find the spot that we DON'T want to use
================
*/
// Moved to g_local.h
//#define MAX_SPAWN_POINTS 128
//#define MAX_SPAWN_POINTS 128
gentity_t *SelectNearestDeathmatchSpawnPoint(vec3_t from)
{
gentity_t *spot;
@ -440,7 +441,7 @@ go to a random point that doesn't telefrag
================
*/
// Moved to g_local.h
//#define MAX_SPAWN_POINTS 128
//#define MAX_SPAWN_POINTS 128
gentity_t *SelectRandomDeathmatchSpawnPoint(void)
{
gentity_t *spot;
@ -515,45 +516,11 @@ gentity_t *SelectRandomFurthestSpawnPoint(vec3_t avoidPoint, vec3_t origin, vec3
}
}
/* NICEASS WAY:
gentity_t *spot;
vec3_t delta;
float dist, furthestDist;
gentity_t *furthestSpot;
furthestDist = 0;
furthestSpot = NULL;
spot = NULL;
while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) {
VectorSubtract( spot->s.origin, from, delta );
dist = VectorLength( delta );
if ( dist > furthestDist ) {
furthestDist = dist;
furthestSpot = spot;
}
}
if (!furthestSpot) {
spot = G_Find( NULL, FOFS(classname), "info_player_deathmatch");
if (!spot)
G_Error( "Couldn't find a spawn point" );
VectorCopy (spot->s.origin, origin);
origin[2] += 9;
VectorCopy (spot->s.angles, angles);
return spot;
}
else {
return furthestSpot;
}
*/
//Makro - on a map with one spawn point, if one player has to respawn and someone is
//already near the spawnpoint, Q3 crashes; added check
if (numSpots != 0) {
// select a random spot from the spawn points furthest away
rnd = random() * (numSpots / 3); // NiceAss: divided by 2 changed to 3 to cut down on close spawns
rnd = random() * (numSpots / 3); // NiceAss: divided by 2 changed to 3 to cut down on close spawns
VectorCopy(list_spot[rnd]->s.origin, origin);
origin[2] += 9;
@ -564,7 +531,7 @@ gentity_t *SelectRandomFurthestSpawnPoint(vec3_t avoidPoint, vec3_t origin, vec3
//Makro - added; note - plenty of room for improvement here, I just wanted to get rid of the crash bug
spot = G_Find(NULL, FOFS(classname), "info_player_deathmatch");
if (!spot) {
G_Error( "Couldn't find a spawn point" );
G_Error("Couldn't find a spawn point");
}
VectorCopy(spot->s.origin, origin);
origin[2] += 9;
@ -572,8 +539,6 @@ gentity_t *SelectRandomFurthestSpawnPoint(vec3_t avoidPoint, vec3_t origin, vec3
return spot;
}
}
/*
@ -586,34 +551,6 @@ Chooses a player start, deathmatch start, etc
gentity_t *SelectSpawnPoint(vec3_t avoidPoint, vec3_t origin, vec3_t angles)
{
return SelectRandomFurthestSpawnPoint(avoidPoint, origin, angles);
/*
gentity_t *spot;
gentity_t *nearestSpot;
nearestSpot = SelectNearestDeathmatchSpawnPoint( avoidPoint );
spot = SelectRandomDeathmatchSpawnPoint ( );
if ( spot == nearestSpot ) {
// roll again if it would be real close to point of death
spot = SelectRandomDeathmatchSpawnPoint ( );
if ( spot == nearestSpot ) {
// last try
spot = SelectRandomDeathmatchSpawnPoint ( );
}
}
// find a single player start spot
if (!spot) {
G_Error( "Couldn't find a spawn point" );
}
VectorCopy (spot->s.origin, origin);
origin[2] += 9;
VectorCopy (spot->s.angles, angles);
return spot;
*/
}
/*
@ -920,7 +857,7 @@ team_t PickTeam(int ignoreClientNum)
{
int counts[TEAM_NUM_TEAMS];
if (g_gametype.integer == GT_TEAMPLAY) {
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
counts[TEAM_BLUE] = RQ3TeamCount(ignoreClientNum, TEAM_BLUE);
counts[TEAM_RED] = RQ3TeamCount(ignoreClientNum, TEAM_RED);
} else {
@ -941,26 +878,6 @@ team_t PickTeam(int ignoreClientNum)
return TEAM_BLUE;
}
/*
===========
ForceClientSkin
Forces a client's skin (for teamplay)
===========
*/
/*
static void ForceClientSkin( gclient_t *client, char *model, const char *skin ) {
char *p;
if ((p = Q_strrchr(model, '/')) != 0) {
*p = 0;
}
Q_strcat(model, MAX_QPATH, "/");
Q_strcat(model, MAX_QPATH, skin);
}
*/
/*
===========
ClientCheckName
@ -1105,7 +1022,6 @@ void ClientUserinfoChanged(int clientNum)
if (client->pers.maxHealth < 1 || client->pers.maxHealth > 100) {
client->pers.maxHealth = 100;
}
// set model
if (g_gametype.integer >= GT_TEAM) {
Q_strncpyz(model, Info_ValueForKey(userinfo, "team_model"), sizeof(model));
@ -1390,8 +1306,8 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot)
}
}
// slicer : make sessionTeam = to savedTeam for scoreboard on cgame
// JBravo: only for teamplay. Could break DM
if (g_gametype.integer == GT_TEAMPLAY) {
// JBravo: only for teambased games. Could break DM
if (g_gametype.integer >= GT_TEAM) {
client->sess.sessionTeam = client->sess.savedTeam;
ClientUserinfoChanged(clientNum);
} else
@ -1411,7 +1327,7 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot)
CalculateRanks();
// JBravo: clients in TP begin as spectators
if (g_gametype.integer == GT_TEAMPLAY) {
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
client->sess.sessionTeam = TEAM_SPECTATOR;
client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR;
client->sess.spectatorState = SPECTATOR_FREE;
@ -1420,13 +1336,13 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot)
client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM;
camera_begin(ent);
client->camera->mode = CAMERA_MODE_SWING;
} else {
client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM;
camera_begin(ent);
client->camera->mode = CAMERA_MODE_SWING;
}
// JBravo: moved from ClientBegin
client->pers.enterTime = level.time;
/* Slicer - no no !! this can't be here !
// JBravo: cleaning up stuff
client->sess.sub = TEAM_FREE;
client->sess.captain = TEAM_FREE;*/
return NULL;
}
@ -1459,13 +1375,6 @@ void ClientBegin(int clientNum)
ent->pain = 0;
ent->client = client;
//Slicer : Reseting matchmode vars
//Note: Each time a player changes team, this will also be called..
//if(g_RQ3_matchmode.integer && g_gametype.integer == GT_TEAMPLAY) {
// client->sess.captain = TEAM_FREE;
// client->sess.sub = TEAM_FREE;
//}
//Slicer: Saving persistant and ping
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
savedPing = client->ps.ping;
@ -1474,7 +1383,6 @@ void ClientBegin(int clientNum)
}
client->pers.connected = CON_CONNECTED;
// client->pers.enterTime = level.time;
client->pers.teamState.state = TEAM_BEGIN;
// save eflags around this, because changing teams will
@ -1492,13 +1400,12 @@ void ClientBegin(int clientNum)
for (i = 0; i < MAX_PERSISTANT; i++)
client->ps.persistant[i] = savedPers[i];
}
// locate ent at a spawn point
ClientSpawn(ent);
// JBravo: if teamplay and the client has not been on teams, make them a spectator.
if ( ( g_gametype.integer == GT_TEAMPLAY && client->sess.savedTeam != TEAM_RED && client->sess.savedTeam != TEAM_BLUE ) ||
( g_gametype.integer == GT_CTF && client->sess.sessionTeam != TEAM_RED && client->sess.sessionTeam != TEAM_BLUE ) ) {
if ((g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) &&
client->sess.sessionTeam != TEAM_RED && client->sess.sessionTeam != TEAM_BLUE) {
client->sess.sessionTeam = TEAM_SPECTATOR;
client->ps.persistant[PERS_SAVEDTEAM] = TEAM_SPECTATOR;
client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR;
@ -1517,6 +1424,13 @@ void ClientBegin(int clientNum)
client->camera->mode = CAMERA_MODE_SWING;
}
if (g_gametype.integer == GT_FFA) {
client->sess.sessionTeam = TEAM_FREE;
client->ps.persistant[PERS_TEAM] = TEAM_FREE;
client->sess.spectatorState = SPECTATOR_NOT;
client->specMode = SPECTATOR_NOT;
}
if (client->sess.sessionTeam != TEAM_SPECTATOR && g_gametype.integer != GT_TEAMPLAY) {
client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENSHORT; //set to short range
client->ps.persistant[PERS_WEAPONMODES] |= RQ3_KNIFEMODE; //set to slash attack
@ -1530,13 +1444,13 @@ void ClientBegin(int clientNum)
G_LogPrintf("ClientBegin: %i\n", clientNum);
// JBravo: synching the cvars over to clients for the MM ingame menu.
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_matchmode.integer) {
for (i = 0; i < 9 ; ++i) {
if ((g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) && g_RQ3_matchmode.integer) {
for (i = 0; i < 9; ++i) {
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %s %i", CVARSET, settings2[i],
trap_Cvar_VariableIntegerValue(settings[i])));
trap_Cvar_VariableIntegerValue(settings[i])));
}
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_capturelimit %i", CVARSET,
trap_Cvar_VariableIntegerValue("capturelimit")));
trap_Cvar_VariableIntegerValue("capturelimit")));
}
// JBravo: setting cvars for the about menu
trap_Cvar_VariableStringBuffer("sv_hostname", str, sizeof(str));
@ -1546,8 +1460,8 @@ void ClientBegin(int clientNum)
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_showOwnKills %i", CVARSET, g_RQ3_showOwnKills.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_timelimit %i", CVARSET, g_timelimit.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_fraglimit %i", CVARSET, g_fraglimit.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_bot_minplayers %i", CVARSET,
trap_Cvar_VariableIntegerValue("bot_minplayers")));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_bot_minplayers %i", CVARSET,
trap_Cvar_VariableIntegerValue("bot_minplayers")));
// count current clients and rank for scoreboard
CalculateRanks();
@ -1569,7 +1483,6 @@ void ClientBegin(int clientNum)
}
i = RQ3TeamCount(-1, client->sess.sessionTeam);
}
}
/*
@ -1583,24 +1496,18 @@ Initializes all non-persistant parts of playerState
*/
void ClientSpawn(gentity_t * ent)
{
int index;
int index, i, flags, savedPing;
int persistant[MAX_PERSISTANT];
vec3_t spawn_origin, spawn_angles;
gclient_t *client;
int i;
clientPersistant_t saved;
clientSession_t savedSess;
int persistant[MAX_PERSISTANT];
gentity_t *spawnPoint;
int flags;
int savedPing;
// char *savedAreaBits;
int accuracy_hits, accuracy_shots;
int eventSequence;
int accuracy_hits, accuracy_shots, eventSequence;
int savedWeapon, savedItem, savedSpec; // JBravo: to save weapon/item info
int savedRadiopower, savedRadiogender; // JBravo: for radio.
int savedMaleSet, savedFemaleSet; // JBravo: for soundset saves.
camera_t savedCamera; // JBravo: to save camera stuff
camera_t savedCamera; // JBravo: to save camera stuff
char userinfo[MAX_INFO_STRING];
char *classname;
@ -1608,24 +1515,23 @@ void ClientSpawn(gentity_t * ent)
//Try to turn the laser off if it's on
if (ent->client->lasersight)
Laser_Gen(ent, qfalse);
Laser_Gen(ent, qfalse);
index = ent - g_entities;
client = ent->client;
spawnPoint = NULL;
// find a spawn point
// do it before setting health back up, so farthest
// ranging doesn't count this client
if (client->sess.sessionTeam == TEAM_SPECTATOR) {
if (g_gametype.integer == GT_CTF && (client->sess.savedTeam == TEAM_RED || client->sess.savedTeam == TEAM_BLUE)) {
spawnPoint = NULL;
if (g_gametype.integer == GT_CTF &&
(client->sess.savedTeam == TEAM_RED || client->sess.savedTeam == TEAM_BLUE)) {
if (client->sess.savedTeam == TEAM_RED)
classname = "team_CTF_redflag";
else if (client->sess.savedTeam == TEAM_BLUE)
classname = "team_CTF_blueflag";
else
G_Printf("Wtf ? What team are U on boy ?\n");
while ((spawnPoint = G_Find(spawnPoint, FOFS(classname), classname)) != NULL) {
if (!(spawnPoint->flags & FL_DROPPED_ITEM))
break;
@ -1634,12 +1540,12 @@ void ClientSpawn(gentity_t * ent)
VectorCopy(spawnPoint->r.currentOrigin, spawn_origin);
VectorCopy(spawnPoint->s.angles, spawn_angles);
spawn_origin[2] += 30;
}
}
} else if (VectorLength(ent->client->ps.origin) == 0.0f) {
// Origin is not set yet? Use a spawn point
// Origin is not set yet? Use a spawn point
spawnPoint = SelectSpectatorSpawnPoint(spawn_origin, spawn_angles);
} // Have a set origin already? Use it. (where you died or changed to spectator)
else {
// Have a set origin already? Use it. (where you died or changed to spectator)
} else {
spawnPoint = NULL;
VectorCopy(ent->client->ps.origin, spawn_origin);
VectorCopy(ent->client->ps.viewangles, spawn_angles);
@ -1668,7 +1574,6 @@ void ClientSpawn(gentity_t * ent)
}
// Freud: Quake3 moves spawns up 9 pixs?
spawn_origin[2] += 9;
// End JBravo.
} else {
do {
@ -1707,7 +1612,6 @@ void ClientSpawn(gentity_t * ent)
saved = client->pers;
savedSess = client->sess;
savedPing = client->ps.ping;
// savedAreaBits = client->areabits;
accuracy_hits = client->accuracy_hits;
accuracy_shots = client->accuracy_shots;
@ -1768,7 +1672,6 @@ void ClientSpawn(gentity_t * ent)
client->pers.maxHealth = 100;
}
// clear entity values
//client->ps.stats[STAT_MAX_HEALTH] = client->pers.maxHealth;
client->ps.eFlags = flags;
ent->s.groundEntityNum = ENTITYNUM_NONE;
@ -1793,20 +1696,20 @@ void ClientSpawn(gentity_t * ent)
//Blaze: changed WP_MACHINEGUN to WP_PISTOL, makes the base weapon you start with the pistol
// JBravo: Not in TP
if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) {
client->ps.stats[STAT_WEAPONS] = (1 << WP_PISTOL);
client->numClips[WP_PISTOL] = 0;
client->ps.ammo[WP_PISTOL] = ClipAmountForAmmo(WP_PISTOL);
if ((int) g_RQ3_weaponban.integer & WPF_MK23) {
client->ps.stats[STAT_WEAPONS] = (1 << WP_PISTOL);
client->numClips[WP_PISTOL] = 0;
client->ps.ammo[WP_PISTOL] = ClipAmountForAmmo(WP_PISTOL);
}
if ((int) g_RQ3_weaponban.integer & WPF_KNIFE) {
client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
client->ps.ammo[WP_KNIFE] = 1;
}
}
//Blaze: Changed WP_GAUNTLET to WP_KNIFE
client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
//Blaze: 1 knife to start with
client->ps.ammo[WP_KNIFE] = 1;
//Blaze: No Grappling Hook in reaction
// client->ps.ammo[WP_GRAPPLING_HOOK] = -1;
//Blaze: Set the bandage variable to 0
client->bleedtick = 0;
// health will count down towards max_health
ent->health = client->ps.stats[STAT_HEALTH] = 100; // max health of 100 client->ps.stats[STAT_MAX_HEALTH];//Blaze: removed * 1.25 becase we wanna start at 100 health
ent->health = client->ps.stats[STAT_HEALTH] = 100; //Blaze: removed * 1.25 becase we wanna start at 100 health
// reset streak count
client->killStreak = 0;
@ -1828,7 +1731,7 @@ void ClientSpawn(gentity_t * ent)
// force the base weapon up
//Blaze: Changed WP_MACHINEGUN to WP_PISTOL
// JBravo: we dont want the endless pistol in TP
if (g_gametype.integer != GT_TEAMPLAY) {
if (g_gametype.integer < GT_TEAM) {
client->ps.weapon = WP_PISTOL;
client->ps.weaponstate = WEAPON_READY;
}
@ -1850,7 +1753,8 @@ void ClientSpawn(gentity_t * ent)
ent->client->ps.stats[STAT_RQ3] = 0;
// JBravo: remember saved specmodes.
if (g_gametype.integer == GT_TEAMPLAY && client->sess.sessionTeam == TEAM_SPECTATOR) {
if ((g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) &&
client->sess.sessionTeam == TEAM_SPECTATOR) {
if (client->specMode == SPECTATOR_FOLLOW || client->specMode == SPECTATOR_FREE) {
client->sess.spectatorState = client->specMode;
client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM;
@ -1889,8 +1793,8 @@ void ClientSpawn(gentity_t * ent)
// select the highest weapon number available, after any
// spawn given items have fired
// JBravo: Lets make sure we have the right weapons
if ( ( g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF ) &&
( client->sess.sessionTeam == TEAM_RED || client->sess.sessionTeam == TEAM_BLUE ) ) {
if ((g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) &&
(client->sess.sessionTeam == TEAM_RED || client->sess.sessionTeam == TEAM_BLUE)) {
EquipPlayer(ent);
} else {
client->ps.weapon = 1;
@ -1910,7 +1814,7 @@ void ClientSpawn(gentity_t * ent)
client->ps.commandTime = level.time - 100;
ent->client->pers.cmd.serverTime = level.time;
// JBravo: We should not have to call this during TP spawns
if (g_gametype.integer != GT_TEAMPLAY)
if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF)
ClientThink(ent - g_entities);
// positively link the client, even if the command times are weird
@ -1921,13 +1825,14 @@ void ClientSpawn(gentity_t * ent)
}
// run the presend to set anything else
// JBravo: We should not have to call this during TP spawns
if (g_gametype.integer != GT_TEAMPLAY)
if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF)
ClientEndFrame(ent);
ent->client->noHead = qfalse;
// JBravo: lock the player down
if (g_gametype.integer == GT_CTF && ent->client->sess.sessionTeam == TEAM_SPECTATOR &&
(ent->client->sess.savedTeam == TEAM_RED || ent->client->sess.savedTeam == TEAM_BLUE))
(ent->client->sess.savedTeam == TEAM_RED || ent->client->sess.savedTeam == TEAM_BLUE) &&
!level.lights_camera_action)
ent->client->ps.pm_type = PM_FREEZE;
// clear entity state values
@ -1979,7 +1884,7 @@ void ClientDisconnect(int clientNum)
}
// aasimon: Referee. If player is referee, clean ref
/*if (clientNum == g_RQ3_RefID.integer)
trap_Cvar_Set("g_RQ3_RefID", "-1");*/
trap_Cvar_Set("g_RQ3_RefID", "-1"); */
// JBravo: if the client had a laser, turn it off so it doesnt stay there forever.
if (ent->client->lasersight) {

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.169 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.168 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
@ -960,7 +963,7 @@ void SetTeam(gentity_t * ent, char *s)
client = ent->client;
clientNum = client - level.clients;
if (g_gametype.integer != GT_TEAMPLAY) {
if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) {
specClient = 0;
specState = SPECTATOR_NOT;
}
@ -982,7 +985,7 @@ void SetTeam(gentity_t * ent, char *s)
specState = SPECTATOR_FREE;
} else if (g_gametype.integer >= GT_TEAM) {
// if running a team game, assign player to one of the teams
if (g_gametype.integer != GT_TEAMPLAY) {
if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) {
specState = SPECTATOR_NOT;
}
if (!Q_stricmp(s, "red") || !Q_stricmp(s, "r") || !Q_stricmp(s, "1")) {
@ -1029,7 +1032,7 @@ void SetTeam(gentity_t * ent, char *s)
// decide if we will allow the change
//
// JBravo: we use the savedTeam var because the player meight be dead.
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
if (g_gametype.integer >= GT_TEAM) {
oldTeam = client->sess.savedTeam;
} else {
oldTeam = client->sess.sessionTeam;
@ -1062,13 +1065,9 @@ void SetTeam(gentity_t * ent, char *s)
}
// JBravo: lets set the correct var here.
if (g_gametype.integer == GT_TEAMPLAY) {
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
client->sess.savedTeam = team;
client->ps.persistant[PERS_SAVEDTEAM] = team;
} else if (g_gametype.integer == GT_CTF) {
client->sess.savedTeam = team;
client->ps.persistant[PERS_SAVEDTEAM] = team;
client->sess.sessionTeam = team;
} else {
client->sess.sessionTeam = team;
}
@ -1093,7 +1092,7 @@ void SetTeam(gentity_t * ent, char *s)
client->sess.spectatorTime = level.time;
}
// JBravo: not messing with spec system in TP during teamswitches
if (g_gametype.integer != GT_TEAMPLAY) {
if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) {
client->sess.spectatorState = specState;
client->sess.spectatorClient = specClient;
}
@ -1124,19 +1123,12 @@ void SetTeam(gentity_t * ent, char *s)
client->radioGender = level.team1gender;
else if (client->sess.savedTeam == TEAM_BLUE)
client->radioGender = level.team2gender;
if (g_gametype.integer == GT_CTF) {
if (client->sess.savedTeam == TEAM_RED) {
if (level.team1respawn == 0)
ClientBegin(clientNum);
} else if (client->sess.savedTeam == TEAM_BLUE) {
if (level.team2respawn == 0)
ClientBegin(clientNum);
}
}
} else {
ClientUserinfoChanged(clientNum);
ClientBegin(clientNum);
}
if (g_gametype.integer == GT_CTF)
MakeSpectator (ent);
}
/*
@ -1177,7 +1169,7 @@ void Cmd_Team_f(gentity_t * ent)
char s[MAX_TOKEN_CHARS];
//Makro - moved here
if (g_gametype.integer == GT_TEAMPLAY) {
if (g_gametype.integer >= GT_TEAM) {
oldTeam = ent->client->sess.savedTeam;
} else {
oldTeam = ent->client->sess.sessionTeam;
@ -1185,7 +1177,7 @@ void Cmd_Team_f(gentity_t * ent)
if (trap_Argc() != 2) {
// JBravo: lets keep the teamnames right.
if (g_gametype.integer == GT_TEAMPLAY) {
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_TEAM) {
//oldTeam = ent->client->sess.savedTeam;
switch (oldTeam) {
case TEAM_RED:
@ -1203,6 +1195,21 @@ void Cmd_Team_f(gentity_t * ent)
trap_SendServerCommand(ent - g_entities, "print \"You have not joined a team.\n\"");
break;
}
} else if (g_gametype.integer == GT_CTF) {
switch (oldTeam) {
case TEAM_RED:
trap_SendServerCommand(ent - g_entities,
va("print \"You are a member of the SILVER team.\n\""));
break;
case TEAM_BLUE:
trap_SendServerCommand(ent - g_entities,
va("print \"You are a member of the BLACK team.\n\""));
break;
case TEAM_SPECTATOR:
case TEAM_FREE:
trap_SendServerCommand(ent - g_entities, "print \"You have not joined a team.\n\"");
break;
}
} else {
//oldTeam = ent->client->sess.sessionTeam;
switch (oldTeam) {
@ -1379,7 +1386,7 @@ static void G_SayTo(gentity_t * ent, gentity_t * other, int mode, int color, con
return;
// JBravo: Dead people dont speak to the living... or so Im told.
if ( !G_PlayerAlive( ent ) && G_PlayerAlive( other ) &&
if (!G_PlayerAlive(ent) && G_PlayerAlive(other) &&
g_gametype.integer == GT_TEAMPLAY && level.team_round_going && mode != SAY_REF)
return;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.127 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.126 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
@ -393,7 +396,7 @@ void TossClientItems(gentity_t * self)
//Elder: added hadUniqueWeapons check - returns to qfalse if died with the gun
//as opposed to dropping it, then died
if ((weaponInventory & (1 << WP_M3)) == (1 << WP_M3)) {
if ((weaponInventory & (1 << WP_M3)) == (1 << WP_M3) && ((int) g_RQ3_weaponban.integer & WPF_M3)) {
while (self->client->weaponCount[WP_M3]) {
item = BG_FindItemForWeapon(WP_M3);
Drop_Item(self, item, angle);
@ -404,7 +407,7 @@ void TossClientItems(gentity_t * self)
}
}
if ((weaponInventory & (1 << WP_M4)) == (1 << WP_M4)) {
if ((weaponInventory & (1 << WP_M4)) == (1 << WP_M4) && ((int) g_RQ3_weaponban.integer & WPF_M4)) {
while (self->client->weaponCount[WP_M4]) {
item = BG_FindItemForWeapon(WP_M4);
Drop_Item(self, item, angle);
@ -415,7 +418,7 @@ void TossClientItems(gentity_t * self)
}
}
if ((weaponInventory & (1 << WP_MP5)) == (1 << WP_MP5)) {
if ((weaponInventory & (1 << WP_MP5)) == (1 << WP_MP5) && ((int) g_RQ3_weaponban.integer & WPF_MP5)) {
while (self->client->weaponCount[WP_MP5]) {
item = BG_FindItemForWeapon(WP_MP5);
Drop_Item(self, item, angle);
@ -426,7 +429,7 @@ void TossClientItems(gentity_t * self)
}
}
if ((weaponInventory & (1 << WP_HANDCANNON)) == (1 << WP_HANDCANNON)) {
if ((weaponInventory & (1 << WP_HANDCANNON)) == (1 << WP_HANDCANNON) && ((int) g_RQ3_weaponban.integer & WPF_HC)) {
while (self->client->weaponCount[WP_HANDCANNON]) {
item = BG_FindItemForWeapon(WP_HANDCANNON);
Drop_Item(self, item, angle);
@ -437,7 +440,7 @@ void TossClientItems(gentity_t * self)
}
}
if ((weaponInventory & (1 << WP_SSG3000)) == (1 << WP_SSG3000)) {
if ((weaponInventory & (1 << WP_SSG3000)) == (1 << WP_SSG3000) && ((int) g_RQ3_weaponban.integer & WPF_SNIPER)) {
while (self->client->weaponCount[WP_SSG3000]) {
item = BG_FindItemForWeapon(WP_SSG3000);
Drop_Item(self, item, angle);
@ -448,12 +451,14 @@ void TossClientItems(gentity_t * self)
}
}
//Elder: Always drop the pistol
item = BG_FindItemForWeapon(WP_PISTOL);
Drop_Item(self, item, angle);
angle += 30;
if ((int) g_RQ3_weaponban.integer & WPF_MK23) {
item = BG_FindItemForWeapon(WP_PISTOL);
Drop_Item(self, item, angle);
angle += 30;
}
//Elder: drop a knife if player has at least one
if (self->client->ps.ammo[WP_KNIFE] > 0) {
if (self->client->ps.ammo[WP_KNIFE] > 0 && ((int) g_RQ3_weaponban.integer & WPF_KNIFE)) {
item = BG_FindItemForWeapon(WP_KNIFE);
Drop_Item(self, item, angle);
angle += 30;
@ -1392,7 +1397,8 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
}
// JBravo: adding the 0wned sound
if (meansOfDeath == MOD_KNIFE) {
trap_SendServerCommand(-1, va("rq3_cmd %i", OWNED));
trap_SendServerCommand(attacker - g_entities, va("rq3_cmd %i", OWNED));
trap_SendServerCommand(self - g_entities, va("rq3_cmd %i", OWNED));
}
attacker->client->lastKillTime = level.time;
}
@ -2192,7 +2198,7 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker,
tent->s.eventParm = DirToByte(dir);
tent->s.otherEntityNum = targ->s.clientNum;
}
take *= 1.8; //+ 1;
take *= 1.8 + 1; //+ 1;
break;
case LOCATION_CHEST:
if (attacker->client && ((g_gametype.integer == GT_TEAMPLAY && level.team_round_going) || g_gametype.integer != GT_TEAMPLAY))
@ -2414,11 +2420,8 @@ qboolean G_RadiusDamage(vec3_t origin, gentity_t * attacker, float damage, float
float points, dist;
gentity_t *ent;
int entityList[MAX_GENTITIES];
int numListedEntities;
vec3_t mins, maxs;
vec3_t v;
vec3_t dir;
int i, e;
int numListedEntities, i, e;
vec3_t mins, maxs, v, dir;
qboolean hitClient = qfalse;
if (radius < 1) {
@ -2455,7 +2458,6 @@ qboolean G_RadiusDamage(vec3_t origin, gentity_t * attacker, float damage, float
}
dist = VectorLength(v);
//if ( dist >= radius ) {
if (dist > radius) {
continue;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.49 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.48 2002/09/09 02:26:18 niceass
// fixed drop case
//
@ -172,10 +175,9 @@ int Pickup_Powerup(gentity_t * ent, gentity_t * other)
int Pickup_Holdable(gentity_t * ent, gentity_t * other)
{
//Elder: why it's implemented like this I have no idea
//JBravo: Neiter do I :( Sucks Monks Nads this way :(
other->client->ps.stats[STAT_HOLDABLE_ITEM] = ent->item - bg_itemlist;
//other->client->ps.stats[STAT_HOLDABLE_ITEM] = ent->item->giTag;
other->client->uniqueItems++;
//Try to fire up the laser if it's picked up
@ -487,7 +489,6 @@ Touch_Item
*/
void Touch_Item(gentity_t * ent, gentity_t * other, trace_t * trace)
{
int respawn;
qboolean predict;
int bandolierFactor;
@ -637,11 +638,9 @@ void Touch_Item(gentity_t * ent, gentity_t * other, trace_t * trace)
break;
case IT_TEAM:
// NiceAss: can't pick it up if it's in mid-flight (someone dropped it)
if ( ent->s.pos.trDelta[2] != 0.0f )
if (ent->s.pos.trDelta[2] != 0.0f)
return;
respawn = Pickup_Team(ent, other);
break;
case IT_HOLDABLE:
//Elder: check to see if it's in mid-air

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.125 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.124 2002/09/08 19:47:03 niceass
// newb ctb message added
//
@ -369,6 +372,17 @@ typedef enum {
#define SP_DOORTOGGLE 8 // Elder: added to enable mover toggling
#define MAXDOORTIME 100 // Elder: max time the opendoor key can stay open
// JBravo: adding weaponbanning
#define WPF_MK23 0x00000001 // 1
#define WPF_MP5 0x00000002 // 2
#define WPF_M4 0x00000004 // 4
#define WPF_M3 0x00000008 // 8
#define WPF_HC 0x00000010 // 16
#define WPF_SNIPER 0x00000020 // 32
#define WPF_DUAL 0x00000040 // 64
#define WPF_KNIFE 0x00000080 // 128
#define WPF_GRENADE 0x00000100 // 256
//============================================================================
typedef struct gentity_s gentity_t;
@ -1355,6 +1369,7 @@ extern vmCvar_t g_RQ3_twbanrounds; // JBravo: no. of games team wounders are ban
extern vmCvar_t g_RQ3_tkbanrounds; // JBravo: no. of games team killers are banned
extern vmCvar_t g_RQ3_ppl_idletime; // JBravo: Seconds Idle before playing an insane sound
extern vmCvar_t g_RQ3_idleaction; // JBravo: what to do with Idlers. 0 = sound, 1 = team none, 2 = kick
extern vmCvar_t g_RQ3_weaponban; // JBravo: Bitmapped cvar for weaponbanning
extern vmCvar_t g_RQ3_ctb_respawndelay; // JBravo: delay in seconds for ctb respawns
//Slicer: Team Status Cvars for MM

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.120 2002/09/29 16:06:44 jbravo
// Work done at the HPWorld expo
//
// Revision 1.119 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
@ -338,7 +341,7 @@
#include "zcam.h"
#include "q_shared.h"
int trap_RealTime(qtime_t *qtime);
int trap_RealTime(qtime_t * qtime);
level_locals_t level;
typedef struct {
@ -437,15 +440,12 @@ vmCvar_t g_RQ3_twbanrounds;
vmCvar_t g_RQ3_tkbanrounds;
vmCvar_t g_RQ3_ppl_idletime;
vmCvar_t g_RQ3_idleaction;
vmCvar_t g_RQ3_weaponban;
vmCvar_t g_RQ3_ctb_respawndelay;
//Slicer: Team Status Cvars for MM
//vmCvar_t g_RQ3_team1ready;
//vmCvar_t g_RQ3_team2ready;
// aasimon: Ref System for MM
vmCvar_t g_RQ3_AllowRef;
vmCvar_t g_RQ3_RefPass;
//vmCvar_t g_RQ3_RefID;
vmCvar_t g_RQ3_maxRefs;
// aasimon: ini stuff
@ -473,6 +473,7 @@ vmCvar_t g_RQ3_cvarfile;
//Makro - for server browsers
vmCvar_t g_RQ3_version;
//Makro - max votes per client
vmCvar_t g_RQ3_maxClientVotes;
@ -489,7 +490,6 @@ static cvarTable_t gameCvarTable[] = {
// latched vars
{&g_gametype, "g_gametype", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qfalse},
{&g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_SYSTEMINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
{&g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
@ -498,29 +498,19 @@ static cvarTable_t gameCvarTable[] = {
{&g_fraglimit, "fraglimit", "20", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue},
{&g_timelimit, "timelimit", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue},
{&g_capturelimit, "capturelimit", "8", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue},
{&g_synchronousClients, "g_synchronousClients", "0", CVAR_SYSTEMINFO, 0, qfalse},
{&g_friendlyFire, "g_friendlyFire", "0", CVAR_ARCHIVE, 0, qtrue},
{&g_teamAutoJoin, "g_teamAutoJoin", "0", CVAR_ARCHIVE},
{&g_teamForceBalance, "g_teamForceBalance", "0", CVAR_ARCHIVE},
{&g_warmup, "g_warmup", "20", CVAR_ARCHIVE, 0, qtrue},
{&g_doWarmup, "g_doWarmup", "0", 0, 0, qtrue},
{&g_log, "g_log", "reaction.log", CVAR_ARCHIVE, 0, qfalse},
{&g_logSync, "g_logSync", "0", CVAR_ARCHIVE, 0, qfalse},
{&g_password, "g_password", "", CVAR_USERINFO, 0, qfalse},
{&g_banIPs, "g_banIPs", "", CVAR_ARCHIVE, 0, qfalse},
{&g_filterBan, "g_filterBan", "1", CVAR_ARCHIVE, 0, qfalse},
{&g_needpass, "g_needpass", "0", CVAR_SERVERINFO | CVAR_ROM, 0, qfalse},
{&g_dedicated, "dedicated", "0", 0, 0, qfalse},
// Elder: slow down to 300?
{&g_speed, "g_speed", "300", 0, 0, qtrue}, // was 320
{&g_gravity, "g_gravity", "800", CVAR_SYSTEMINFO, 0, qtrue}, // shared with client (cg_gravity)
{&g_quadfactor, "g_quadfactor", "3", 0, 0, qtrue},
@ -533,7 +523,6 @@ static cvarTable_t gameCvarTable[] = {
{&g_debugAlloc, "g_debugAlloc", "0", 0, 0, qfalse},
{&g_motd, "g_motd", "", 0, 0, qfalse},
{&g_blood, "com_blood", "1", 0, 0, qfalse},
{&g_podiumDist, "g_podiumDist", "80", 0, 0, qfalse},
{&g_podiumDrop, "g_podiumDrop", "70", 0, 0, qfalse},
@ -549,7 +538,6 @@ static cvarTable_t gameCvarTable[] = {
{&g_smoothClients, "g_smoothClients", "1", 0, 0, qfalse},
{&pmove_fixed, "pmove_fixed", "0", CVAR_SYSTEMINFO, 0, qfalse},
{&pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO, 0, qfalse},
{&g_rankings, "g_rankings", "0", 0, 0, qfalse},
//Slicer: Matchmode
{&g_RQ3_matchmode, "g_RQ3_matchmode", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_SYSTEMINFO, 0, qfalse},
@ -595,6 +583,7 @@ static cvarTable_t gameCvarTable[] = {
{&g_RQ3_ppl_idletime, "g_RQ3_ppl_idletime", "0", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_ctb_respawndelay, "g_RQ3_ctb_respawndelay", "0", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_idleaction, "g_RQ3_idleaction", "0", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_weaponban, "g_RQ3_weaponban", "511", CVAR_ARCHIVE, 0, qtrue},
//Blaze: let cvar.cfg be set by the server admins
{&g_RQ3_cvarfile, "g_RQ3_cvarfile", "cvar.cfg", CVAR_ARCHIVE, 0, qtrue},
//Slicer: Team Status Cvars for MM
@ -785,12 +774,17 @@ void G_RegisterCvars(void)
}
// JBravo: lets disable the untested modes.
if (g_gametype.integer != GT_FFA && g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF &&
g_gametype.integer != GT_TOURNAMENT) {
g_gametype.integer != GT_TOURNAMENT) {
G_Printf("g_gametype %i is currently not supported by ReactionQuake3. Defaulting to 0\n",
g_gametype.integer);
trap_Cvar_Set("g_gametype", "0");
}
if (g_gametype.integer == GT_CTF) {
trap_Cvar_Set("g_RQ3_team1name", "SILVER");
trap_Cvar_Set("g_RQ3_team2name", "BLACK");
}
level.warmupModificationCount = g_warmup.modificationCount;
}
@ -882,14 +876,12 @@ void RQ3_loadmodels(void)
dirptr[dirlen - 1] = '\0';
if (!strcmp(dirptr, ".") || !strcmp(dirptr, ".."))
continue;
// Com_Printf("models (%s)\n", dirptr);
len = trap_FS_FOpenFile(va("models/players/%s/rq3model.cfg", dirptr), &file, FS_READ);
if (file) {
trap_FS_Read(buf, len, file);
buf[len] = 0;
text_p = buf;
trap_FS_FCloseFile(file);
// Com_Printf("Adding %s as a legit model\n", dirptr);
Com_sprintf(legitmodels[modelcount].name, sizeof(legitmodels[modelcount].name), "%s", dirptr);
for (j = 0; j < 3; j++) {
token = COM_Parse(&text_p);
@ -1077,7 +1069,6 @@ void G_InitGame(int levelTime, int randomSeed, int restart)
}
// JBravo: reset teamplay stuff.
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
//Slicer: Default Radio Gender according to MODEL gender
Q_strncpyz(model, g_RQ3_team1model.string, sizeof(model));
Q_strncpyz(model2, g_RQ3_team2model.string, sizeof(model));
@ -1109,7 +1100,7 @@ void G_InitGame(int levelTime, int randomSeed, int restart)
level.team1respawn = level.team2respawn = 0;
}
// Slicer: reset matchmode vars
if (g_RQ3_matchmode.integer && g_gametype.integer == GT_TEAMPLAY) {
if (g_RQ3_matchmode.integer && (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF)) {
level.matchTime = 0;
level.inGame = qfalse;
level.team1ready = qfalse;
@ -1604,7 +1595,6 @@ void FindIntermissionPoint(void)
}
}
}
}
/*
@ -1621,7 +1611,7 @@ void BeginIntermission(void)
return; // already active
}
if ( g_RQ3_ValidIniFile.integer == 1 )
if (g_RQ3_ValidIniFile.integer == 1)
trap_SendServerCommand(-1, va("print \"Next map in rotation is %s\n\"", g_RQ3_NextMap.string));
// if in tournement mode, change the wins / losses
@ -1723,7 +1713,6 @@ void ExitLevel(void)
level.clients[i].pers.connected = CON_CONNECTING;
}
}
}
/*
@ -1787,16 +1776,17 @@ void LogExit(const char *string)
int i, numSorted;
gclient_t *cl;
qtime_t now;
char* names_day[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
char* names_month[] = { "January", "February", "March", "April", "May", "June", "July", "August",
"September", "October", "November", "December" };
char *names_day[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
char *names_month[] = { "January", "February", "March", "April", "May", "June", "July", "August",
"September", "October", "November", "December" };
trap_RealTime(&now);
G_LogPrintf("Game ending at %s %i %s %i %02i:%02i:%02i : %s\n", names_day[now.tm_wday], now.tm_mday, names_month[now.tm_mon],
(now.tm_year)+1900, now.tm_hour, now.tm_min, now.tm_sec, string);
trap_SendServerCommand(-1, va("print \"Game ending at %s %i %s %i %i:%i:%i.\n\"", names_day[now.tm_wday],
now.tm_mday, names_month[now.tm_mon], (now.tm_year)+1900, now.tm_hour,
now.tm_min, now.tm_sec, string));
G_LogPrintf("Game ending at %s %i %s %i %02i:%02i:%02i : %s\n", names_day[now.tm_wday], now.tm_mday,
names_month[now.tm_mon], (now.tm_year) + 1900, now.tm_hour, now.tm_min, now.tm_sec, string);
trap_SendServerCommand(-1,
va("print \"Game ending at %s %i %s %i %i:%i:%i.\n\"", names_day[now.tm_wday],
now.tm_mday, names_month[now.tm_mon], (now.tm_year) + 1900, now.tm_hour, now.tm_min,
now.tm_sec, string));
level.intermissionQueued = level.time;
@ -1906,49 +1896,9 @@ and then, if a player presses BUTTON_ATTACK, change the map
*/
void CheckIntermissionExit(void)
{
// int ready, notReady;
int i;
gclient_t *cl;
// int readyMask;
/* if ( g_gametype.integer == GT_SINGLE_PLAYER ) {
return;
}
// see which players are ready
ready = 0;
notReady = 0;
readyMask = 0;
for (i=0 ; i< g_maxclients.integer ; i++) {
cl = level.clients + i;
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
if ( g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT ) {
continue;
}
if ( cl->readyToExit ) {
ready++;
if ( i < 16 ) {
readyMask |= 1 << i;
}
} else {
notReady++;
}
}
// copy the readyMask to each player's stats so
// it can be displayed on the scoreboard
for (i=0 ; i< g_maxclients.integer ; i++) {
cl = level.clients + i;
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
cl->ps.stats[STAT_CLIENTS_READY] = readyMask;
}
*/
// never exit in less than five seconds
if (level.time < level.intermissiontime + 5000) {
return;
@ -1968,33 +1918,6 @@ void CheckIntermissionExit(void)
if (g_entities[cl->ps.clientNum].client->buttons & BUTTON_ATTACK)
ExitLevel();
}
/*
// if nobody wants to go, clear timer
if ( !ready ) {
level.readyToExit = qfalse;
return;
}
// if everyone wants to go, go now
if ( !notReady ) {
ExitLevel();
return;
}
// the first person to ready starts the ten second timeout
if ( !level.readyToExit ) {
level.readyToExit = qtrue;
level.exitTime = level.time;
}
// if we have waited ten seconds since at least one player
// wanted to exit, go ahead
if ( level.time < level.exitTime + 10000 ) {
return;
}
ExitLevel();
*/
}
/*
@ -2075,15 +1998,6 @@ void CheckExitRules(void)
return;
}
// check for sudden death
// NiceAss: Not needed in any RQ3 variant?
/*
if (ScoreIsTied()) {
// always wait for sudden death
return;
}
*/
if (g_timelimit.integer && !level.warmupTime) {
if (level.time - level.startTime >= g_timelimit.integer * 60000) {
trap_SendServerCommand(-1, "print \"Timelimit hit.\n\"");
@ -2141,7 +2055,6 @@ void CheckExitRules(void)
return;
}
}
}
/*
@ -2268,11 +2181,11 @@ void CheckVote(void)
if (level.voteExecuteTime && level.voteExecuteTime < level.time) {
level.voteExecuteTime = 0;
if (Q_stricmp(level.voteString, "cyclemap") == 0)
BeginIntermission();
BeginIntermission();
else if (Q_stricmp(level.voteString, "map") == 0) {
trap_Cvar_Set("g_RQ3_ValidIniFile", "2"); // check this latter. This trap may not be necessary
g_RQ3_ValidIniFile.integer = 2;
BeginIntermission();
trap_Cvar_Set("g_RQ3_ValidIniFile", "2"); // check this latter. This trap may not be necessary
g_RQ3_ValidIniFile.integer = 2;
BeginIntermission();
} else if (Q_stricmp(level.voteString, "g_gametype") == 0) {
trap_SendConsoleCommand(EXEC_APPEND, va("%s\n", level.voteString));
trap_SendConsoleCommand(EXEC_APPEND, "map_restart 0\n");
@ -2299,7 +2212,6 @@ void CheckVote(void)
}
level.voteTime = 0;
trap_SetConfigstring(CS_VOTE_TIME, "");
}
/*
@ -2425,7 +2337,6 @@ void CheckTeamVote(int team)
}
level.teamVoteTime[cs_offset] = 0;
trap_SetConfigstring(CS_TEAMVOTE_TIME + cs_offset, "");
}
/*
@ -2482,21 +2393,19 @@ Advances the non-player objects in the world
*/
void G_RunFrame(int levelTime)
{
int i;
gentity_t *ent;
//Blaze: Used for droping knifes
//gitem_t *xr_item;
//gentity_t *xr_drop;
//int temp;
int msec;
int start, end;
int i, msec, start, end;
// if we are waiting for the level to restart, do nothing
if (level.restarted) {
return;
}
/* if (g_gametype.integer == GT_CTF && g_RQ3_matchmode.integer && level.team_round_going &&
(!level.team1ready || !level.team2ready || level.paused)) {
return;
} */
level.framenum++;
level.previousTime = level.time;
level.time = levelTime;
@ -2517,33 +2426,13 @@ void G_RunFrame(int levelTime)
// clear events that are too old
if (level.time - ent->eventTime > EVENT_VALID_MSEC) {
if (ent->s.event) {
//G_Printf("Discarded: %i\n", ent->s.event & ~EV_EVENT_BITS);
ent->s.event = 0; // &= EV_EVENT_BITS;
if (ent->client) {
ent->client->ps.externalEvent = 0;
// predicted events should never be set to zero
//ent->client->ps.events[0] = 0;
//ent->client->ps.events[1] = 0;
}
}
if (ent->freeAfterEvent) {
//Elder: moved to g_missile.c where it belongs
// tempEntities or dropped items completely go away after their event
//if (!strcmp(ent->classname,"weapon_knife"))
//{
/*
xr_item = BG_FindItemForWeapon( WP_KNIFE );
//Elder: removed
//xr_drop= dropWeapon( ent, xr_item, 0, FL_THROWN_ITEM );//FL_DROPPED_ITEM |
xr_drop = LaunchItem(xr_item, ent->s.pos.trBase, 0, FL_THROWN_KNIFE);
G_FreeEntity( ent );
*/
//}
//else
//{
G_FreeEntity(ent);
//}
continue;
} else if (ent->unlinkAfterEvent) {
// items that will respawn will hide themselves after their pickup event
@ -2574,13 +2463,6 @@ void G_RunFrame(int levelTime)
G_RunMover(ent);
continue;
}
/*
// Elder: run dynamic lights
if (ent->s.eType == ET_DLIGHT) {
G_RunDlight(ent);
continue;
}
*/
if (i < MAX_CLIENTS) {
G_RunClient(ent); // Basicly calls ClientThink_real()
@ -2607,11 +2489,7 @@ void G_RunFrame(int levelTime)
CheckTournament();
}
// see if it is time to end the level
// JBravo: no need if teamplay
// Slicer: We will need it now for the rotation system..
// if ( g_gametype.integer != GT_TEAMPLAY ) {
CheckExitRules();
// }
// update to team status?
// JBravo: no need if teamplay
@ -2621,8 +2499,8 @@ void G_RunFrame(int levelTime)
// cancel vote if timed out
CheckVote();
// JBravo: this is the main function in g_teamplay that does everything
if (g_gametype.integer == GT_TEAMPLAY) {
// JBravo: this is the main function in g_teamplay that does everything for TP and CTB
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
CheckTeamRules();
}
// Slicer: matchmode
@ -2722,13 +2600,12 @@ void RQ3_ReadInitFile()
char *buf;
int len;
if ( g_RQ3_ValidIniFile.integer == 3 ){
trap_Cvar_Set( "g_RQ3_ValidIniFile", "1");
if (g_RQ3_ValidIniFile.integer == 3) {
trap_Cvar_Set("g_RQ3_ValidIniFile", "1");
trap_SendConsoleCommand(EXEC_APPEND, va("%s\n", level.voteMap));
return;
}else
if ( g_RQ3_ValidIniFile.integer == 2 ){
trap_Cvar_Set( "g_RQ3_ValidIniFile", "1");
} else if (g_RQ3_ValidIniFile.integer == 2) {
trap_Cvar_Set("g_RQ3_ValidIniFile", "1");
trap_SendConsoleCommand(EXEC_APPEND, va("%s %s\n", level.voteString, level.voteMap));
return;
}
@ -2775,7 +2652,6 @@ void RQ3_ParseBuffer(char *buf, int len)
return;
// now we found a tag, so we start loading parameters for the kind of tag
if (RQ3_ParseBlock(tag_type, tag, &cur_pos, buf, len) == PARSING_ERROR)
return;
}
@ -2783,9 +2659,6 @@ void RQ3_ParseBuffer(char *buf, int len)
G_Printf("RQ3 config system: Finished loading the ini File\n");
return;
// Can't go here
//G_Printf ( "RQ3 config system: Invalid init file\n" );
}
int RQ3_GetTag(char *buf, int *cur_pos, char *tag, int len)
@ -2912,8 +2785,6 @@ int RQ3_ParseBlock(int tag_type, char *tag, int *cur_pos, char *buf, int len)
if (RQ3_GetTag(buf, cur_pos, tag, len) == MAP) {
G_Printf("RQ3 config system: Prossessing block <map>\n");
// Process the map block here
// G_Printf ("RQ3 config system: g_RQ3_NextMapID is: %d and map_number is: %d \n", g_RQ3_NextMapID.integer, map_number);
if (RQ3_GetWord(buf, cur_pos, word_buff, len) == TOKEN_TAG)
if (RQ3_CheckClosingTag(buf, cur_pos, MAP, len) == PARSING_OK) {
map_number++;
@ -2993,7 +2864,6 @@ int RQ3_GetWord(char *buf, int *cur_pos, char *word, int len)
{
int count;
// for (;; (*cur_pos)++) {
for (;;) {
if (*(buf + *cur_pos) == '"') {
count = 0;
@ -3027,7 +2897,6 @@ int RQ3_GetWord(char *buf, int *cur_pos, char *word, int len)
break;
}
}
// }
return TOKEN_WORD;
}
@ -3037,7 +2906,6 @@ int RQ3_GetCommand(char *buf, int *cur_pos, char *cvar, char *value, int len)
int state = NONE;
int count;
// for (;; (*cur_pos)++) {
for (;;) {
if (*(buf + *cur_pos) == '<') // closing block
return TOKEN_TAG;
@ -3084,8 +2952,6 @@ int RQ3_GetCommand(char *buf, int *cur_pos, char *cvar, char *value, int len)
return TOKEN_CVAR;
}
}
//}
}
char *known_tags[] = { "main", "rotation", "map", "cvars", "team1", "team2" };

View file

@ -80,6 +80,7 @@ void MM_RunFrame(void)
switch (g_gametype.integer) {
//Each Type has different ways of dealing things..
case (GT_TEAMPLAY):
case (GT_CTF):
if (level.team_game_going && level.inGame)
level.matchTime += 1.0f / (float) fps;
break;
@ -156,14 +157,19 @@ void MM_Ready_f(gentity_t * ent)
if (!g_RQ3_matchmode.integer)
return;
if(level.inGame && (g_RQ3_mmflags.integer & MMF_UNREADY) != MMF_UNREADY) {
if (level.inGame && (g_RQ3_mmflags.integer & MMF_UNREADY) != MMF_UNREADY) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR "This server does not allow you to un-ready your team after the match started\n\""));
return;
}
if (level.inGame && g_gametype.integer == GT_CTF) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR "CTB does not yet support un-readying your team after the match started\n\""));
return;
}
if (ent->client->sess.captain != TEAM_FREE) {
if (ent->client->sess.savedTeam == TEAM_RED) {
trap_SendServerCommand(-1, va("cp \"%s are%s Ready.\n\"",
trap_SendServerCommand(-1, va("cp \"%s is%s Ready.\n\"",
g_RQ3_team1name.string, level.team1ready ? " no longer" : ""));
if (level.team1ready)
@ -171,7 +177,7 @@ void MM_Ready_f(gentity_t * ent)
else
level.team1ready = qtrue;
} else {
trap_SendServerCommand(-1, va("cp \"%s are%s Ready.\n\"",
trap_SendServerCommand(-1, va("cp \"%s is%s Ready.\n\"",
g_RQ3_team2name.string, level.team2ready ? " no longer" : ""));
if (level.team2ready)
@ -397,7 +403,7 @@ void MM_ClearScores(qboolean clearTeamFlags)
ent->client->ps.persistant[PERS_KILLED] = 0;
ent->client->ps.persistant[PERS_DAMAGE_DELT] = 0;
}
if (g_gametype.integer == GT_TEAMPLAY) {
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) {
level.teamScores[TEAM_RED] = 0;
level.teamScores[TEAM_BLUE] = 0;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.31 2002/09/29 16:06:45 jbravo
// Work done at the HPWorld expo
//
// Revision 1.30 2002/08/28 23:10:06 jbravo
// Added cg_RQ3_SuicideLikeARealMan, timestamping to server logs and
// fixed stats for non-TP modes.
@ -577,7 +580,6 @@ gentity_t *fire_grenade(gentity_t * self, vec3_t start, vec3_t dir)
if ((g_gametype.integer == GT_TEAMPLAY && level.team_round_going) || g_gametype.integer != GT_TEAMPLAY)
self->client->pers.records[REC_GRENADESHOTS]++;
if (self->client->ps.stats[STAT_HEALTH] <= 0 ||
// (self->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK ||
self->client->ps.weaponstate == WEAPON_BANDAGING ||
// NiceAss: Should catch any case of switching weapons with a grenade "cocked"
self->client->ps.weaponstate == WEAPON_DROPPING) {

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.21 2002/09/29 16:06:45 jbravo
// Work done at the HPWorld expo
//
// Revision 1.20 2002/08/23 14:25:05 slicer
// Added a new Referee System with multiple ref support
//
@ -88,7 +91,7 @@ void G_WriteClientSessionData(gclient_t * client)
//Slicer how about savedTeam ?!
if (!g_RQ3_matchmode.integer && g_gametype.integer == GT_TEAMPLAY) {
if (!g_RQ3_matchmode.integer && (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF)) {
//Reset teams on map changes / map_restarts, except on matchmode
client->sess.savedTeam = TEAM_SPECTATOR;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.16 2002/09/29 16:06:45 jbravo
// Work done at the HPWorld expo
//
// Revision 1.15 2002/09/08 19:46:27 niceass
// newb ctb message added
//
@ -197,8 +200,8 @@ qboolean OnSameTeam(gentity_t * ent1, gentity_t * ent2)
if (g_gametype.integer < GT_TEAM) {
return qfalse;
}
// JBravo: fixing for TP
if (g_gametype.integer == GT_TEAMPLAY) {
// JBravo: fixing for TP and other team based games
if (g_gametype.integer >= GT_TEAM) {
if (ent1->client->sess.savedTeam == ent2->client->sess.savedTeam) {
return qtrue;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.139 2002/09/29 16:06:45 jbravo
// Work done at the HPWorld expo
//
// Revision 1.138 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
@ -479,8 +482,7 @@ gentity_t *FindClientByPersName(char *name)
void CheckTeamRules()
{
int winner, i, checked_tie = 0;
gentity_t *player;
int winner, checked_tie = 0;
//Slicer
if (level.intermissiontime)
@ -537,14 +539,7 @@ void CheckTeamRules()
if (level.team_round_countdown)
level.team_round_countdown--;
if (g_RQ3_tpcountdown.integer && level.team_round_countdown == (101 * level.fps) / 10) {
for (i = 0; i < level.maxclients; i++) {
player = &g_entities[i];
if (!player->inuse)
continue;
G_AddEvent(player, EV_RQ3_SOUND, RQ3_SOUND_COUNTDOWN);
}
trap_SendServerCommand(-1, va("rq3_cmd %i", TPCOUNTDOWN));
trap_SendServerCommand(-1, va("rq3_cmd %i 0", MAPSTART));
}
@ -561,8 +556,6 @@ void CheckTeamRules()
if (level.matchTime >= g_timelimit.integer * 60) {
level.inGame = level.team_round_going = level.team_round_countdown =
level.team_game_going = level.matchTime = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
level.team1ready = qfalse;
level.team2ready = qfalse;
MakeAllLivePlayersObservers();
@ -573,10 +566,7 @@ void CheckTeamRules()
if (level.time - level.startTime >= g_timelimit.integer * 60000) {
//Slicer : Let's do a normal console print instead..
trap_SendServerCommand(-1, "print \"Timelimit hit.\n\"");
//trap_SendServerCommand( -1, va("cp \"Timelimit hit.\n\""));
level.team_round_going = level.team_round_countdown = level.team_game_going = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
//Slicer: Start Intermission
BeginIntermission();
return;
@ -586,15 +576,20 @@ void CheckTeamRules()
if (!level.team_round_countdown) {
if (BothTeamsHavePlayers()) {
//Slicer let's print to the console too
trap_SendServerCommand(-1, "print \"The round will begin in 20 seconds!\n\"");
trap_SendServerCommand(-1, va("cp \"The round will begin in 20 seconds!\n\""));
if (g_gametype.integer == GT_TEAMPLAY) {
trap_SendServerCommand(-1, "print \"The round will begin in 20 seconds!\n\"");
trap_SendServerCommand(-1, va("cp \"The round will begin in 20 seconds!\n\""));
} else {
trap_SendServerCommand(-1, "print \"The game will begin in 20 seconds!\n\"");
trap_SendServerCommand(-1, va("cp \"The game will begin in 20 seconds!\n\""));
}
level.team_round_countdown = (201 * level.fps) / 10;
//Blaze: moved from below the G_AddEvent
trap_SendServerCommand(-1, va("rq3_cmd %i 0", STARTDEMO));
//Blaze: moved from below the G_AddEvent
trap_SendServerCommand(-1, va("rq3_cmd %i 0", STARTDEMO));
}
}
} else {
if ((winner = CheckForWinner()) != WINNER_NONE) {
if (g_gametype.integer == GT_TEAMPLAY && ((winner = CheckForWinner()) != WINNER_NONE)) {
if (!checked_tie) {
level.holding_on_tie_check = (50 * level.fps) / 10;
return;
@ -602,22 +597,19 @@ void CheckTeamRules()
if (WonGame(winner))
return;
level.team_round_going = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
level.lights_camera_action = 0;
level.holding_on_tie_check = 0;
level.team_round_countdown = (71 * level.fps) / 10;
return;
}
if (g_RQ3_roundtimelimit.integer && (level.current_round_length > g_RQ3_roundtimelimit.integer * 60 * level.fps)) {
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_roundtimelimit.integer &&
(level.current_round_length > g_RQ3_roundtimelimit.integer * 60 * level.fps)) {
trap_SendServerCommand(-1, va("cp \"Round timelimit hit.\n\""));
winner = CheckForForcedWinner();
if (WonGame(winner))
return;
level.team_round_going = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
level.lights_camera_action = 0;
level.holding_on_tie_check = 0;
level.team_round_countdown = (71 * level.fps) / 10;
@ -632,7 +624,12 @@ void StartLCA()
trap_Cvar_Set("g_RQ3_lca", "1");
level.lights_camera_action = (41 * level.fps) / 10;
G_LogPrintf("LIGHTS...\n");
SpawnPlayers();
if (g_gametype.integer == GT_TEAMPLAY) {
SpawnPlayers();
} else {
RQ3_Respawn_CTB_players(TEAM_RED);
RQ3_Respawn_CTB_players(TEAM_BLUE);
}
level.lights_delay = 4;
}
@ -646,8 +643,6 @@ void ContinueLCA()
trap_SendServerCommand(-1, va("rq3_cmd %i", ACTION));
trap_Cvar_Set("g_RQ3_lca", "0");
level.team_round_going = 1;
//Slicer: apparently not being used
//trap_SendServerCommand(-1, va("rq3_cmd %i 1", ROUND));
level.current_round_length = 0;
}
level.lights_camera_action--;
@ -705,7 +700,7 @@ void CleanLevel()
if (!Q_stricmp(ent->classname, "func_static")) {
ent->count = (ent->spawnflags & 1);
ent->use(ent, NULL, NULL);
//Makro - reset door health each round
//Makro - reset door health each round
} else if (ent->s.eType == ET_MOVER && ent->takedamage) {
ent->health = ent->health_saved;
}
@ -837,8 +832,6 @@ int WonGame(int winner)
SendEndMessage();
level.inGame = level.team_round_going = level.team_round_countdown =
level.team_game_going = level.matchTime = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
level.team1ready = qfalse;
level.team2ready = qfalse;
MakeAllLivePlayersObservers();
@ -848,8 +841,6 @@ int WonGame(int winner)
if (level.time - level.startTime >= g_timelimit.integer * 60000) {
trap_SendServerCommand(-1, "print \"Timelimit hit.\n\"");
level.team_round_going = level.team_round_countdown = level.team_game_going = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
//Slicer: Start Intermission
BeginIntermission();
return 1;
@ -865,8 +856,6 @@ int WonGame(int winner)
SendEndMessage();
level.inGame = level.team_round_going = level.team_round_countdown =
level.team_game_going = level.matchTime = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
level.team1ready = qfalse;
level.team2ready = qfalse;
MakeAllLivePlayersObservers();
@ -876,8 +865,6 @@ int WonGame(int winner)
trap_SendServerCommand(-1, "print \"Roundlimit hit.\n\"");
trap_SendServerCommand(-1, va("cp \"Roundlimit hit.\n\""));
level.team_round_going = level.team_round_countdown = level.team_game_going = 0;
//Slicer: apparently not being used
//trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
//Slicer: Start Intermission
BeginIntermission();
return 1;
@ -891,8 +878,6 @@ team_t RQ3TeamCount(int ignoreClientNum, int team)
{
int i, count = 0;
// char buf[64];
for (i = 0; i < level.maxclients; i++) {
if (i == ignoreClientNum) {
continue;
@ -908,16 +893,6 @@ team_t RQ3TeamCount(int ignoreClientNum, int team)
}
}
/* Com_sprintf (buf, sizeof(buf), "%i", count);
if (team == TEAM_RED)
trap_Cvar_Set("g_RQ3_teamCount1", buf);
else if (team == TEAM_BLUE)
trap_Cvar_Set("g_RQ3_teamCount2", buf);
else if (team == TEAM_SPECTATOR || team == TEAM_FREE)
trap_Cvar_Set("g_RQ3_numSpectators", buf); */
//Com_sprintf (buf, sizeof(buf), "setteamplayers %i %i\n", team, count);
//trap_SendServerCommand(-1, buf);
return count;
}
@ -964,8 +939,8 @@ void SpawnPlayers()
if (!player->inuse || !player->client)
continue;
//Slicer: Matchmode - Subs don't spawn
//Slicer: Matchmode - Subs don't spawn
if (g_RQ3_matchmode.integer && player->client->sess.sub != TEAM_FREE)
continue;
// JBravo: lets not respawn spectators in free floating mode
@ -988,9 +963,8 @@ void SpawnPlayers()
client->sess.spectatorState = SPECTATOR_NOT;
}
client->ps.stats[STAT_RQ3] &= ~RQ3_PLAYERSOLID;
ResetKills (player);
ResetKills(player);
client->last_damaged_players[0] = '\0';
// trap_SendServerCommand(player-g_entities, "lights");
ClientSpawn(player);
ClientUserinfoChanged(clientNum);
client->sess.teamSpawn = qfalse;
@ -1032,26 +1006,54 @@ void RQ3_Cmd_Choose_f(gentity_t * ent)
cmd = ConcatArgs(1);
if (Q_stricmp(cmd, RQ3_MP5_NAME) == 0 || Q_stricmp(cmd, "mp5") == 0) {
ent->client->teamplayWeapon = WP_MP5;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_MP5_NAME));
if ((int) g_RQ3_weaponban.integer & WPF_MP5) {
ent->client->teamplayWeapon = WP_MP5;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_MP5_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_MP5_NAME));
}
} else if (Q_stricmp(cmd, RQ3_M3_NAME) == 0 || Q_stricmp(cmd, "m3") == 0) {
ent->client->teamplayWeapon = WP_M3;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_M3_NAME));
if ((int) g_RQ3_weaponban.integer & WPF_M3) {
ent->client->teamplayWeapon = WP_M3;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_M3_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_M3_NAME));
}
} else if (Q_stricmp(cmd, RQ3_M4_NAME) == 0 || Q_stricmp(cmd, "m4") == 0) {
ent->client->teamplayWeapon = WP_M4;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_M4_NAME));
if ((int) g_RQ3_weaponban.integer & WPF_M4) {
ent->client->teamplayWeapon = WP_M4;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_M4_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_M4_NAME));
}
} else if (Q_stricmp(cmd, RQ3_HANDCANNON_NAME) == 0 || Q_stricmp(cmd, "hc") == 0) {
ent->client->teamplayWeapon = WP_HANDCANNON;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_HANDCANNON_NAME));
if ((int) g_RQ3_weaponban.integer & WPF_HC) {
ent->client->teamplayWeapon = WP_HANDCANNON;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_HANDCANNON_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_HANDCANNON_NAME));
}
} else if (Q_stricmp(cmd, RQ3_SSG3000_NAME) == 0 || Q_stricmp(cmd, "sniper") == 0) {
ent->client->teamplayWeapon = WP_SSG3000;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_SSG3000_NAME));
if ((int) g_RQ3_weaponban.integer & WPF_SNIPER) {
ent->client->teamplayWeapon = WP_SSG3000;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_SSG3000_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_SSG3000_NAME));
}
} else if (Q_stricmp(cmd, RQ3_KNIFE_NAME) == 0 || Q_stricmp(cmd, "knives") == 0) {
ent->client->teamplayWeapon = WP_KNIFE;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_KNIFE_NAME));
if ((int) g_RQ3_weaponban.integer & WPF_KNIFE) {
ent->client->teamplayWeapon = WP_KNIFE;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_KNIFE_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_KNIFE_NAME));
}
} else if (Q_stricmp(cmd, RQ3_AKIMBO_NAME) == 0 || Q_stricmp(cmd, "akimbo") == 0) {
ent->client->teamplayWeapon = WP_AKIMBO;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_AKIMBO_NAME));
if ((int) g_RQ3_weaponban.integer & WPF_DUAL) {
ent->client->teamplayWeapon = WP_AKIMBO;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_AKIMBO_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_AKIMBO_NAME));
}
} else if (Q_stricmp(cmd, RQ3_KEVLAR_NAME) == 0 || Q_stricmp(cmd, "kevlar") == 0) {
ent->client->teamplayItem = HI_KEVLAR;
trap_SendServerCommand(ent - g_entities, va("print \"Item selected: %s\n\"", RQ3_KEVLAR_NAME));
@ -1103,7 +1105,7 @@ void Cmd_Dropcase_f(gentity_t * ent)
} else {
trap_SendServerCommand(ent - g_entities, va("print \"Huh? You dont have a flag to drop!\n\""));
}
}
void RQ3_Cmd_Drop_f(gentity_t * ent)
@ -1136,9 +1138,7 @@ void EquipPlayer(gentity_t * ent)
return;
bandolierFactor = grenades = 0;
ent->client->numClips[WP_PISTOL] = ent->client->numClips[WP_AKIMBO] = 1; // extra clip of ammo for pistol
ent->client->ps.ammo[WP_PISTOL] = RQ3_PISTOL_AMMO;
ent->client->ps.stats[STAT_WEAPONS] = 0;
if (ent->client->teamplayItem == HI_BANDOLIER) {
bandolierFactor = 2;
@ -1147,11 +1147,19 @@ void EquipPlayer(gentity_t * ent)
bandolierFactor = 1;
}
if ((int) g_RQ3_weaponban.integer & WPF_MK23) {
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_PISTOL);
ent->client->numClips[WP_PISTOL] = ent->client->numClips[WP_AKIMBO] = 1; // extra clip of ammo for pistol
ent->client->ps.ammo[WP_PISTOL] = RQ3_PISTOL_AMMO;
}
if ((int) g_RQ3_weaponban.integer & WPF_KNIFE) {
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
}
switch (ent->client->teamplayWeapon) {
case WP_SSG3000:
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_PISTOL);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_SSG3000);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
ent->client->numClips[WP_SSG3000] = RQ3_SSG3000_EXTRA_AMMO * bandolierFactor;
ent->client->ps.ammo[WP_SSG3000] = RQ3_SSG3000_AMMO;
if (g_RQ3_sniperup.integer == 1) {
@ -1165,9 +1173,7 @@ void EquipPlayer(gentity_t * ent)
ent->client->uniqueWeapons = 1;
break;
case WP_MP5:
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_MP5);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_PISTOL);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_MP5);
ent->client->numClips[WP_MP5] = RQ3_MP5_EXTRA_AMMO * bandolierFactor;
ent->client->ps.ammo[WP_MP5] = RQ3_MP5_AMMO;
ent->client->ps.weapon = WP_MP5;
@ -1176,9 +1182,7 @@ void EquipPlayer(gentity_t * ent)
ent->client->uniqueWeapons = 1;
break;
case WP_M3:
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_M3);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_PISTOL);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_M3);
ent->client->numClips[WP_M3] = RQ3_M3_EXTRA_AMMO * bandolierFactor;
ent->client->ps.ammo[WP_M3] = RQ3_M3_AMMO;
ent->client->ps.weapon = WP_M3;
@ -1187,9 +1191,7 @@ void EquipPlayer(gentity_t * ent)
ent->client->uniqueWeapons = 1;
break;
case WP_M4:
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_M4);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_PISTOL);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_M4);
ent->client->numClips[WP_M4] = RQ3_M4_EXTRA_AMMO * bandolierFactor;
ent->client->ps.ammo[WP_M4] = RQ3_M4_AMMO;
ent->client->ps.weapon = WP_M4;
@ -1198,11 +1200,10 @@ void EquipPlayer(gentity_t * ent)
ent->client->uniqueWeapons = 1;
break;
case WP_AKIMBO:
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_AKIMBO);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_PISTOL);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_AKIMBO);
//Makro - added pistol clips
ent->client->numClips[WP_PISTOL] = ent->client->numClips[WP_AKIMBO] = RQ3_AKIMBO_EXTRA_AMMO * bandolierFactor;
ent->client->numClips[WP_PISTOL] = ent->client->numClips[WP_AKIMBO] =
RQ3_AKIMBO_EXTRA_AMMO * bandolierFactor;
ent->client->ps.ammo[WP_AKIMBO] = RQ3_AKIMBO_AMMO;
ent->client->ps.weapon = WP_AKIMBO;
ent->client->ps.weaponTime = RQ3_AKIMBO_ACTIVATE_DELAY;
@ -1210,9 +1211,7 @@ void EquipPlayer(gentity_t * ent)
ent->client->uniqueWeapons = 0;
break;
case WP_HANDCANNON:
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_HANDCANNON);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_PISTOL);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_KNIFE);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_HANDCANNON);
ent->client->numClips[WP_HANDCANNON] = RQ3_HANDCANNON_EXTRA_AMMO * bandolierFactor;
ent->client->ps.ammo[WP_HANDCANNON] = RQ3_HANDCANNON_AMMO;
ent->client->ps.weapon = WP_HANDCANNON;
@ -1221,8 +1220,6 @@ void EquipPlayer(gentity_t * ent)
ent->client->uniqueWeapons = 1;
break;
case WP_KNIFE:
ent->client->ps.stats[STAT_WEAPONS] = (1 << WP_KNIFE);
ent->client->ps.stats[STAT_WEAPONS] |= (1 << WP_PISTOL);
ent->client->ps.ammo[WP_KNIFE] = RQ3_KNIVES_EXTRA_AMMO * bandolierFactor;
ent->client->ps.weapon = WP_KNIFE;
ent->client->ps.weaponTime = RQ3_KNIFE_ACTIVATE_DELAY;
@ -1251,12 +1248,11 @@ void EquipPlayer(gentity_t * ent)
}
ent->client->ps.weaponstate = WEAPON_RAISING;
if (ent->client->teamplayItem) {
ent->client->ps.stats[STAT_HOLDABLE_ITEM] = BG_FindItemForHoldable(ent->client->teamplayItem) - bg_itemlist;
ent->client->ps.stats[STAT_HOLDABLE_ITEM] =
BG_FindItemForHoldable(ent->client->teamplayItem) - bg_itemlist;
ent->client->uniqueItems = 1;
}
else {
} else {
G_Printf("%s had an illegal teamplay item [%i]!\n", ent->client->pers.netname,
ent->client->teamplayItem);
}
@ -1287,7 +1283,7 @@ void UnstickPlayer(gentity_t * ent)
}
}
void RQ3_StartTimer (int team, int delay)
void RQ3_StartTimer(int team, int delay)
{
int i;
gentity_t *ent;
@ -1315,7 +1311,8 @@ void RQ3_Respawn_CTB_players(int team)
ent = &g_entities[i];
if (!ent->inuse || !ent->client)
continue;
if (ent->client->sess.savedTeam == team && ent->client->sess.spectatorState == SPECTATOR_FREE) {
if (ent->client->sess.savedTeam == team && (ent->client->sess.spectatorState == SPECTATOR_FREE ||
level.lights_camera_action)) {
ent->client->weaponCount[ent->client->ps.weapon] = ent->client->savedPSweapon;
ent->client->ps.stats[STAT_WEAPONS] = ent->client->savedSTAT;
ent->client->sess.sessionTeam = team;
@ -1334,7 +1331,7 @@ void MakeSpectator(gentity_t * ent)
int i;
client = ent->client;
if (client->sess.sessionTeam == TEAM_SPECTATOR)
if (g_gametype.integer == GT_TEAMPLAY && client->sess.sessionTeam == TEAM_SPECTATOR)
return;
if (!client->gibbed || ent->s.eType != ET_INVISIBLE)
CopyToBodyQue(ent);
@ -1346,10 +1343,10 @@ void MakeSpectator(gentity_t * ent)
continue;
if (follower->client->pers.connected != CON_CONNECTED)
continue;
if (follower->client->sess.sessionTeam != TEAM_SPECTATOR)
if (follower->client->sess.sessionTeam != TEAM_SPECTATOR)
continue;
if (follower->client->sess.spectatorClient == ent->s.number &&
follower->client->sess.spectatorState == SPECTATOR_FOLLOW)
follower->client->sess.spectatorState == SPECTATOR_FOLLOW)
Cmd_FollowCycle_f(follower, 1);
}
}
@ -1362,7 +1359,7 @@ void MakeSpectator(gentity_t * ent)
client->sess.sessionTeam = TEAM_SPECTATOR;
client->ps.persistant[PERS_TEAM] = TEAM_SPECTATOR;
if (g_gametype.integer == GT_CTF) {
if (g_gametype.integer == GT_CTF && level.team_round_going) {
client->sess.spectatorState = SPECTATOR_FREE;
client->specMode = SPECTATOR_FREE;
client->ps.pm_flags &= ~PMF_FOLLOW;
@ -1557,7 +1554,7 @@ radio_msg_t male_radio_msgs[] = {
{"plost1", 1},
{"plost2", 1},
{"plost3", 1},
{"END", 0}, // end of list delimiter
{"END", 0}, // end of list delimiter
};
radio_msg_t female_radio_msgs[] = {
@ -1618,7 +1615,7 @@ radio_msg_t female_radio_msgs[] = {
{"plost1", 1},
{"plost2", 1},
{"plost3", 1},
{"END", 0}, // end of list delimiter
{"END", 0}, // end of list delimiter
};
//Slicer Adding Flood Protection Functions
@ -1651,7 +1648,6 @@ qboolean CheckForFlood(gentity_t * ent)
}
return qtrue;
}
qboolean CheckForRepeat(gentity_t * ent, int radioCode)
@ -1733,17 +1729,12 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
continue;
if (IsInIgnoreList(player, ent))
continue;
if (g_gametype.integer != GT_TEAMPLAY) {
if (player->client->sess.sessionTeam == ent->client->sess.sessionTeam)
trap_SendServerCommand(player - g_entities,
va("rq3_cmd %i %i %i %i\n", RADIO,
kills - 1, ent->client->radioGender, set));
} else {
if (player->client->sess.savedTeam == ent->client->sess.savedTeam)
trap_SendServerCommand(player - g_entities,
va("rq3_cmd %i %i %i %i\n", RADIO,
kills - 1, ent->client->radioGender, set));
}
if (player->client->sess.savedTeam == ent->client->sess.savedTeam &&
player->client->radioOff == qfalse)
trap_SendServerCommand(player - g_entities,
va("rq3_cmd %i %i %i %i\n", RADIO,
kills - 1, ent->client->radioGender,
set));
}
}
}
@ -1753,30 +1744,17 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
continue;
if (IsInIgnoreList(player, ent))
continue;
if (g_gametype.integer != GT_TEAMPLAY) {
if (player->client->sess.sessionTeam == ent->client->sess.sessionTeam) {
if (player->r.svFlags & SVF_BOT)
trap_SendServerCommand(player - g_entities,
va("print \"radio %s %s\n\"",
ent->client->pers.netname,
radio_msgs[x].msg));
else
trap_SendServerCommand(player - g_entities,
va("rq3_cmd %i %i %i %i\n", RADIO, x,
ent->client->radioGender, set));
}
} else {
if (player->client->sess.savedTeam == ent->client->sess.savedTeam) {
if (player->r.svFlags & SVF_BOT)
trap_SendServerCommand(player - g_entities,
va("print \"radio %s %s\n\"",
ent->client->pers.netname,
radio_msgs[x].msg));
else
trap_SendServerCommand(player - g_entities,
va("rq3_cmd %i %i %i %i\n", RADIO, x,
ent->client->radioGender, set));
}
if (player->client->sess.savedTeam == ent->client->sess.savedTeam &&
player->client->radioOff == qfalse) {
if (player->r.svFlags & SVF_BOT)
trap_SendServerCommand(player - g_entities,
va("print \"radio %s %s\n\"",
ent->client->pers.netname,
radio_msgs[x].msg));
else
trap_SendServerCommand(player - g_entities,
va("rq3_cmd %i %i %i %i\n", RADIO, x,
ent->client->radioGender, set));
}
}
//Slicer lets return to stop the while if found..
@ -2046,7 +2024,7 @@ void GetNearbyTeammates(gentity_t * self, char *buf)
}
}
void GetLastDamagedPlayers (gentity_t * ent, char *buf)
void GetLastDamagedPlayers(gentity_t * ent, char *buf)
{
if (ent->client->last_damaged_players[0] == '\0')
strcpy(buf, "nobody");
@ -2099,7 +2077,7 @@ void ParseSayText(gentity_t * ent, char *text)
if (g_RQ3_showOwnKills.integer)
GetLastKilledTarget(ent, infobuf);
else
GetLastDamagedPlayers (ent, infobuf);
GetLastDamagedPlayers(ent, infobuf);
strcpy(pbuf, infobuf);
pbuf = SeekBufEnd(pbuf);
p += 2;
@ -2122,10 +2100,10 @@ void ParseSayText(gentity_t * ent, char *text)
pbuf = SeekBufEnd (pbuf);
p += 2;
continue; */
case 'P':
GetLastDamagedPlayers (ent, infobuf);
strcpy (pbuf, infobuf);
pbuf = SeekBufEnd (pbuf);
case 'P':
GetLastDamagedPlayers(ent, infobuf);
strcpy(pbuf, infobuf);
pbuf = SeekBufEnd(pbuf);
p += 2;
continue;
}
@ -2199,7 +2177,8 @@ void RQ3_Cmd_Use_f(gentity_t * ent)
trap_SendServerCommand(ent - g_entities, buf);
return;
}
if (g_gametype.integer == GT_CTF && (ent->client->ps.powerups[PW_REDFLAG] || ent->client->ps.powerups[PW_BLUEFLAG]))
if (g_gametype.integer == GT_CTF
&& (ent->client->ps.powerups[PW_REDFLAG] || ent->client->ps.powerups[PW_BLUEFLAG]))
return;
if (Q_stricmp(cmd, RQ3_MP5_NAME) == 0 || Q_stricmp(cmd, "mp5") == 0) {
if ((ent->client->ps.stats[STAT_WEAPONS] & (1 << WP_MP5)) == (1 << WP_MP5)) {
@ -2329,7 +2308,8 @@ void Add_TeamKill(gentity_t * attacker)
char *value;
// NiceAss: No TKing in matchmode
if ((g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) || !attacker->client || g_RQ3_matchmode.integer)
if ((g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) || !attacker->client
|| g_RQ3_matchmode.integer)
return;
attacker->client->team_kills++;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.23 2002/09/29 16:06:45 jbravo
// Work done at the HPWorld expo
//
// Revision 1.22 2002/08/26 00:41:53 makro
// Presets menu + editor
//
@ -6104,145 +6107,78 @@ qboolean ItemParse_hideCvar(itemDef_t * item, int handle)
}
keywordHash_t itemParseKeywords[] = {
{"name", ItemParse_name, NULL}
,
{"name", ItemParse_name, NULL},
//Makro - support for shortcut keys
{"shortcutkey", ItemParse_shortcutKey, NULL}
,
{"shortcutkey", ItemParse_shortcutKey, NULL},
//Makro - fixed text height for autowrapped items
{"textHeight", ItemParse_textHeight, NULL}
,
{"text", ItemParse_text, NULL}
,
{"group", ItemParse_group, NULL}
,
{"asset_model", ItemParse_asset_model, NULL}
,
{"asset_shader", ItemParse_asset_shader, NULL}
,
{"model_origin", ItemParse_model_origin, NULL}
,
{"model_fovx", ItemParse_model_fovx, NULL}
,
{"model_fovy", ItemParse_model_fovy, NULL}
,
{"model_rotation", ItemParse_model_rotation, NULL}
,
{"model_angle", ItemParse_model_angle, NULL}
,
{"textHeight", ItemParse_textHeight, NULL},
{"text", ItemParse_text, NULL},
{"group", ItemParse_group, NULL},
{"asset_model", ItemParse_asset_model, NULL},
{"asset_shader", ItemParse_asset_shader, NULL},
{"model_origin", ItemParse_model_origin, NULL},
{"model_fovx", ItemParse_model_fovx, NULL},
{"model_fovy", ItemParse_model_fovy, NULL},
{"model_rotation", ItemParse_model_rotation, NULL},
{"model_angle", ItemParse_model_angle, NULL},
//Makro - support for 3 angles
{"model_angles", ItemParse_model_angles, NULL}
,
{"rect", ItemParse_rect, NULL}
,
{"style", ItemParse_style, NULL}
,
{"decoration", ItemParse_decoration, NULL}
,
{"notselectable", ItemParse_notselectable, NULL}
,
{"wrapped", ItemParse_wrapped, NULL}
,
{"autowrapped", ItemParse_autowrapped, NULL}
,
{"horizontalscroll", ItemParse_horizontalscroll, NULL}
,
{"type", ItemParse_type, NULL}
,
{"elementwidth", ItemParse_elementwidth, NULL}
,
{"elementheight", ItemParse_elementheight, NULL}
,
{"feeder", ItemParse_feeder, NULL}
,
{"elementtype", ItemParse_elementtype, NULL}
,
{"columns", ItemParse_columns, NULL}
,
{"border", ItemParse_border, NULL}
,
{"model_angles", ItemParse_model_angles, NULL},
{"rect", ItemParse_rect, NULL},
{"style", ItemParse_style, NULL},
{"decoration", ItemParse_decoration, NULL},
{"notselectable", ItemParse_notselectable, NULL},
{"wrapped", ItemParse_wrapped, NULL},
{"autowrapped", ItemParse_autowrapped, NULL},
{"horizontalscroll", ItemParse_horizontalscroll, NULL},
{"type", ItemParse_type, NULL},
{"elementwidth", ItemParse_elementwidth, NULL},
{"elementheight", ItemParse_elementheight, NULL},
{"feeder", ItemParse_feeder, NULL},
{"elementtype", ItemParse_elementtype, NULL},
{"columns", ItemParse_columns, NULL},
{"border", ItemParse_border, NULL},
//Makro - for drop shadow effects
{"shadowStyle", ItemParse_shadowStyle, NULL}
,
{"bordersize", ItemParse_bordersize, NULL}
,
{"visible", ItemParse_visible, NULL}
,
{"ownerdraw", ItemParse_ownerdraw, NULL}
,
{"align", ItemParse_align, NULL}
,
{"textalign", ItemParse_textalign, NULL}
,
{"textalignx", ItemParse_textalignx, NULL}
,
{"textaligny", ItemParse_textaligny, NULL}
,
{"textscale", ItemParse_textscale, NULL}
,
{"textstyle", ItemParse_textstyle, NULL}
,
{"backcolor", ItemParse_backcolor, NULL}
,
{"forecolor", ItemParse_forecolor, NULL}
,
{"bordercolor", ItemParse_bordercolor, NULL}
,
{"outlinecolor", ItemParse_outlinecolor, NULL}
,
{"background", ItemParse_background, NULL}
,
{"onFocus", ItemParse_onFocus, NULL}
,
{"leaveFocus", ItemParse_leaveFocus, NULL}
,
{"shadowStyle", ItemParse_shadowStyle, NULL},
{"bordersize", ItemParse_bordersize, NULL},
{"visible", ItemParse_visible, NULL},
{"ownerdraw", ItemParse_ownerdraw, NULL},
{"align", ItemParse_align, NULL},
{"textalign", ItemParse_textalign, NULL},
{"textalignx", ItemParse_textalignx, NULL},
{"textaligny", ItemParse_textaligny, NULL},
{"textscale", ItemParse_textscale, NULL},
{"textstyle", ItemParse_textstyle, NULL},
{"backcolor", ItemParse_backcolor, NULL},
{"forecolor", ItemParse_forecolor, NULL},
{"bordercolor", ItemParse_bordercolor, NULL},
{"outlinecolor", ItemParse_outlinecolor, NULL},
{"background", ItemParse_background, NULL},
{"onFocus", ItemParse_onFocus, NULL},
{"leaveFocus", ItemParse_leaveFocus, NULL},
//Makro - for timers
{"onTimer", ItemParse_onTimer, NULL}
,
{"mouseEnter", ItemParse_mouseEnter, NULL}
,
{"mouseExit", ItemParse_mouseExit, NULL}
,
{"mouseEnterText", ItemParse_mouseEnterText, NULL}
,
{"mouseExitText", ItemParse_mouseExitText, NULL}
,
{"action", ItemParse_action, NULL}
,
{"special", ItemParse_special, NULL}
,
{"cvar", ItemParse_cvar, NULL}
,
{"maxChars", ItemParse_maxChars, NULL}
,
{"maxPaintChars", ItemParse_maxPaintChars, NULL}
,
{"focusSound", ItemParse_focusSound, NULL}
,
{"cvarFloat", ItemParse_cvarFloat, NULL}
,
{"cvarStrList", ItemParse_cvarStrList, NULL}
,
{"cvarFloatList", ItemParse_cvarFloatList, NULL}
,
{"addColorRange", ItemParse_addColorRange, NULL}
,
{"ownerdrawFlag", ItemParse_ownerdrawFlag, NULL}
,
{"enableCvar", ItemParse_enableCvar, NULL}
,
{"cvarTest", ItemParse_cvarTest, NULL}
,
{"disableCvar", ItemParse_disableCvar, NULL}
,
{"showCvar", ItemParse_showCvar, NULL}
,
{"hideCvar", ItemParse_hideCvar, NULL}
,
{"cinematic", ItemParse_cinematic, NULL}
,
{"doubleclick", ItemParse_doubleClick, NULL}
,
{"onTimer", ItemParse_onTimer, NULL},
{"mouseEnter", ItemParse_mouseEnter, NULL},
{"mouseExit", ItemParse_mouseExit, NULL},
{"mouseEnterText", ItemParse_mouseEnterText, NULL},
{"mouseExitText", ItemParse_mouseExitText, NULL},
{"action", ItemParse_action, NULL},
{"special", ItemParse_special, NULL},
{"cvar", ItemParse_cvar, NULL},
{"maxChars", ItemParse_maxChars, NULL},
{"maxPaintChars", ItemParse_maxPaintChars, NULL},
{"focusSound", ItemParse_focusSound, NULL},
{"cvarFloat", ItemParse_cvarFloat, NULL},
{"cvarStrList", ItemParse_cvarStrList, NULL},
{"cvarFloatList", ItemParse_cvarFloatList, NULL},
{"addColorRange", ItemParse_addColorRange, NULL},
{"ownerdrawFlag", ItemParse_ownerdrawFlag, NULL},
{"enableCvar", ItemParse_enableCvar, NULL},
{"cvarTest", ItemParse_cvarTest, NULL},
{"disableCvar", ItemParse_disableCvar, NULL},
{"showCvar", ItemParse_showCvar, NULL},
{"hideCvar", ItemParse_hideCvar, NULL},
{"cinematic", ItemParse_cinematic, NULL},
{"doubleclick", ItemParse_doubleClick, NULL},
{NULL, NULL, NULL}
};