mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2025-02-16 17:21:04 +00:00
Fixed all but one warning in "game".
This commit is contained in:
parent
38d3ea252b
commit
a02fabfad7
20 changed files with 248 additions and 218 deletions
|
@ -3014,7 +3014,8 @@ int AINode_MoveToNextCheckpoint( bot_state_t *bs )
|
||||||
gentity_t *next = NULL, *prev = NULL, *ent = NULL;
|
gentity_t *next = NULL, *prev = NULL, *ent = NULL;
|
||||||
int nextCheckpoint;
|
int nextCheckpoint;
|
||||||
int lastCheckpoint;
|
int lastCheckpoint;
|
||||||
float f, dist, speed, accel, actualSpeed, dot, a_normal, curvature;
|
float f, dist, speed, actualSpeed, dot, curvature;
|
||||||
|
//float accel, a_normal;
|
||||||
int throttleChange;
|
int throttleChange;
|
||||||
|
|
||||||
if (BotIsObserver(bs)) {
|
if (BotIsObserver(bs)) {
|
||||||
|
|
|
@ -4251,7 +4251,7 @@ int BotGetActivateGoal(bot_state_t *bs, int entitynum, bot_activategoal_t *activ
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
trap_AAS_ValueForBSPEpairKey(ent, "classname", classname, sizeof(classname));
|
trap_AAS_ValueForBSPEpairKey(ent, "classname", classname, sizeof(classname));
|
||||||
if (!classname) {
|
if (!*classname) {
|
||||||
BotAI_Print(PRT_ERROR, "BotGetActivateGoal: entity with model %s has no classname\n", model);
|
BotAI_Print(PRT_ERROR, "BotGetActivateGoal: entity with model %s has no classname\n", model);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -4516,7 +4516,7 @@ void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate) {
|
||||||
#ifdef OBSTACLEDEBUG
|
#ifdef OBSTACLEDEBUG
|
||||||
ClientName(bs->client, netname, sizeof(netname));
|
ClientName(bs->client, netname, sizeof(netname));
|
||||||
BotAI_Print(PRT_MESSAGE, "%s: I'm blocked by model %d\n", netname, entinfo.modelindex);
|
BotAI_Print(PRT_MESSAGE, "%s: I'm blocked by model %d\n", netname, entinfo.modelindex);
|
||||||
#endif OBSTACLEDEBUG
|
#endif // OBSTACLEDEBUG
|
||||||
// if blocked by a bsp model and the bot wants to activate it
|
// if blocked by a bsp model and the bot wants to activate it
|
||||||
if (activate && entinfo.modelindex > 0 && entinfo.modelindex <= max_bspmodelindex) {
|
if (activate && entinfo.modelindex > 0 && entinfo.modelindex <= max_bspmodelindex) {
|
||||||
// find the bsp entity which should be activated in order to get the blocking entity out of the way
|
// find the bsp entity which should be activated in order to get the blocking entity out of the way
|
||||||
|
@ -5535,5 +5535,3 @@ BotShutdownDeathmatchAI
|
||||||
void BotShutdownDeathmatchAI(void) {
|
void BotShutdownDeathmatchAI(void) {
|
||||||
altroutegoals_setup = qfalse;
|
altroutegoals_setup = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ int BotSortTeamMatesByBaseTravelTime(bot_state_t *bs, int *teammates, int maxtea
|
||||||
char buf[MAX_INFO_STRING];
|
char buf[MAX_INFO_STRING];
|
||||||
static int maxclients;
|
static int maxclients;
|
||||||
int traveltimes[MAX_CLIENTS];
|
int traveltimes[MAX_CLIENTS];
|
||||||
bot_goal_t *goal;
|
bot_goal_t *goal = NULL;
|
||||||
|
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
if (gametype == GT_CTF /*|| gametype == GT_1FCTF*/) {
|
if (gametype == GT_CTF /*|| gametype == GT_1FCTF*/) {
|
||||||
|
@ -148,7 +148,6 @@ int BotSortTeamMatesByBaseTravelTime(bot_state_t *bs, int *teammates, int maxtea
|
||||||
goal = &blueobelisk;
|
goal = &blueobelisk;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!maxclients)
|
if (!maxclients)
|
||||||
maxclients = trap_Cvar_VariableIntegerValue("sv_maxclients");
|
maxclients = trap_Cvar_VariableIntegerValue("sv_maxclients");
|
||||||
|
|
||||||
|
|
|
@ -2059,6 +2059,9 @@ static void PM_Alt_Weapon( void ) {
|
||||||
case WP_FLAME_THROWER:
|
case WP_FLAME_THROWER:
|
||||||
ammo_use = 3;
|
ammo_use = 3;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
ammo_use = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pm->ps->ammo[ pm->ps->weapon ] > ammo_use ) {
|
if ( pm->ps->ammo[ pm->ps->weapon ] > ammo_use ) {
|
||||||
|
|
|
@ -20,6 +20,7 @@ along with q3rally; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
===========================================================================
|
===========================================================================
|
||||||
*/
|
*/
|
||||||
|
//
|
||||||
|
|
||||||
#include "g_local.h"
|
#include "g_local.h"
|
||||||
|
|
||||||
|
@ -375,7 +376,7 @@ void G_TouchTriggers( gentity_t *ent ) {
|
||||||
gentity_t *hit;
|
gentity_t *hit;
|
||||||
trace_t trace;
|
trace_t trace;
|
||||||
vec3_t mins, maxs;
|
vec3_t mins, maxs;
|
||||||
vec3_t range = { 40, 40, 52 };
|
static vec3_t range = { 40, 40, 52 };
|
||||||
|
|
||||||
if ( !ent->client ) {
|
if ( !ent->client ) {
|
||||||
return;
|
return;
|
||||||
|
@ -850,7 +851,7 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SelectSpawnPoint( ent->client->ps.origin, origin, angles );
|
SelectSpawnPoint( ent->client->ps.origin, origin, angles, qfalse );
|
||||||
TeleportPlayer( ent, origin, angles );
|
TeleportPlayer( ent, origin, angles );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ go to a random point that doesn't telefrag
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
#define MAX_SPAWN_POINTS 128
|
#define MAX_SPAWN_POINTS 128
|
||||||
gentity_t *SelectRandomDeathmatchSpawnPoint( void ) {
|
gentity_t *SelectRandomDeathmatchSpawnPoint(qboolean isbot) {
|
||||||
gentity_t *spot;
|
gentity_t *spot;
|
||||||
int count;
|
int count;
|
||||||
int selection;
|
int selection;
|
||||||
|
@ -163,11 +163,19 @@ gentity_t *SelectRandomDeathmatchSpawnPoint( void ) {
|
||||||
count = 0;
|
count = 0;
|
||||||
spot = NULL;
|
spot = NULL;
|
||||||
|
|
||||||
while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) {
|
while((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL && count < MAX_SPAWN_POINTS)
|
||||||
if ( SpotWouldTelefrag( spot ) ) {
|
{
|
||||||
|
if(SpotWouldTelefrag(spot))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(((spot->flags & FL_NO_BOTS) && isbot) ||
|
||||||
|
((spot->flags & FL_NO_HUMANS) && !isbot))
|
||||||
|
{
|
||||||
|
// spot is not for this human/bot player
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
spots[ count ] = spot;
|
|
||||||
|
spots[count] = spot;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,47 +194,65 @@ SelectRandomFurthestSpawnPoint
|
||||||
Chooses a player start, deathmatch start, etc
|
Chooses a player start, deathmatch start, etc
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
gentity_t *SelectRandomFurthestSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles ) {
|
gentity_t *SelectRandomFurthestSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles, qboolean isbot ) {
|
||||||
gentity_t *spot;
|
gentity_t *spot;
|
||||||
vec3_t delta;
|
vec3_t delta;
|
||||||
float dist;
|
float dist;
|
||||||
float list_dist[64];
|
float list_dist[MAX_SPAWN_POINTS];
|
||||||
gentity_t *list_spot[64];
|
gentity_t *list_spot[MAX_SPAWN_POINTS];
|
||||||
int numSpots, rnd, i, j;
|
int numSpots, rnd, i, j;
|
||||||
|
|
||||||
numSpots = 0;
|
numSpots = 0;
|
||||||
spot = NULL;
|
spot = NULL;
|
||||||
|
|
||||||
while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) {
|
while((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL)
|
||||||
if ( SpotWouldTelefrag( spot ) ) {
|
{
|
||||||
|
if(SpotWouldTelefrag(spot))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(((spot->flags & FL_NO_BOTS) && isbot) ||
|
||||||
|
((spot->flags & FL_NO_HUMANS) && !isbot))
|
||||||
|
{
|
||||||
|
// spot is not for this human/bot player
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorSubtract( spot->s.origin, avoidPoint, delta );
|
VectorSubtract( spot->s.origin, avoidPoint, delta );
|
||||||
dist = VectorLength( delta );
|
dist = VectorLength( delta );
|
||||||
for (i = 0; i < numSpots; i++) {
|
|
||||||
if ( dist > list_dist[i] ) {
|
for (i = 0; i < numSpots; i++)
|
||||||
if ( numSpots >= 64 )
|
{
|
||||||
numSpots = 64-1;
|
if(dist > list_dist[i])
|
||||||
for (j = numSpots; j > i; j--) {
|
{
|
||||||
|
if (numSpots >= MAX_SPAWN_POINTS)
|
||||||
|
numSpots = MAX_SPAWN_POINTS - 1;
|
||||||
|
|
||||||
|
for(j = numSpots; j > i; j--)
|
||||||
|
{
|
||||||
list_dist[j] = list_dist[j-1];
|
list_dist[j] = list_dist[j-1];
|
||||||
list_spot[j] = list_spot[j-1];
|
list_spot[j] = list_spot[j-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
list_dist[i] = dist;
|
list_dist[i] = dist;
|
||||||
list_spot[i] = spot;
|
list_spot[i] = spot;
|
||||||
|
|
||||||
numSpots++;
|
numSpots++;
|
||||||
if (numSpots > 64)
|
|
||||||
numSpots = 64;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i >= numSpots && numSpots < 64) {
|
|
||||||
|
if(i >= numSpots && numSpots < MAX_SPAWN_POINTS)
|
||||||
|
{
|
||||||
list_dist[numSpots] = dist;
|
list_dist[numSpots] = dist;
|
||||||
list_spot[numSpots] = spot;
|
list_spot[numSpots] = spot;
|
||||||
numSpots++;
|
numSpots++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!numSpots) {
|
|
||||||
spot = G_Find( NULL, FOFS(classname), "info_player_deathmatch");
|
if(!numSpots)
|
||||||
|
{
|
||||||
|
spot = G_Find(NULL, FOFS(classname), "info_player_deathmatch");
|
||||||
|
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
// if (!spot)
|
// if (!spot)
|
||||||
// G_Error( "Couldn't find a spawn point" );
|
// G_Error( "Couldn't find a spawn point" );
|
||||||
|
@ -237,6 +263,7 @@ gentity_t *SelectRandomFurthestSpawnPoint ( vec3_t avoidPoint, vec3_t origin, ve
|
||||||
G_Error( "Couldn't find a spawn point" );
|
G_Error( "Couldn't find a spawn point" );
|
||||||
}
|
}
|
||||||
// END
|
// END
|
||||||
|
|
||||||
VectorCopy (spot->s.origin, origin);
|
VectorCopy (spot->s.origin, origin);
|
||||||
origin[2] += 9;
|
origin[2] += 9;
|
||||||
VectorCopy (spot->s.angles, angles);
|
VectorCopy (spot->s.angles, angles);
|
||||||
|
@ -260,8 +287,8 @@ SelectSpawnPoint
|
||||||
Chooses a player start, deathmatch start, etc
|
Chooses a player start, deathmatch start, etc
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
gentity_t *SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles ) {
|
gentity_t *SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles, qboolean isbot ) {
|
||||||
return SelectRandomFurthestSpawnPoint( avoidPoint, origin, angles );
|
return SelectRandomFurthestSpawnPoint( avoidPoint, origin, angles, isbot );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
gentity_t *spot;
|
gentity_t *spot;
|
||||||
|
@ -300,20 +327,26 @@ Try to find a spawn point marked 'initial', otherwise
|
||||||
use normal spawn selection.
|
use normal spawn selection.
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
gentity_t *SelectInitialSpawnPoint( vec3_t origin, vec3_t angles ) {
|
gentity_t *SelectInitialSpawnPoint( vec3_t origin, vec3_t angles, qboolean isbot ) {
|
||||||
gentity_t *spot;
|
gentity_t *spot;
|
||||||
|
|
||||||
spot = NULL;
|
spot = NULL;
|
||||||
while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) {
|
|
||||||
if ( spot->spawnflags & 1 ) {
|
while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL)
|
||||||
break;
|
{
|
||||||
}
|
if(((spot->flags & FL_NO_BOTS) && isbot) ||
|
||||||
|
((spot->flags & FL_NO_HUMANS) && !isbot))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !spot || SpotWouldTelefrag( spot ) ) {
|
if((spot->spawnflags & 0x01))
|
||||||
return SelectSpawnPoint( vec3_origin, origin, angles );
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!spot || SpotWouldTelefrag(spot))
|
||||||
|
return SelectSpawnPoint(vec3_origin, origin, angles, isbot);
|
||||||
|
|
||||||
VectorCopy (spot->s.origin, origin);
|
VectorCopy (spot->s.origin, origin);
|
||||||
origin[2] += 9;
|
origin[2] += 9;
|
||||||
VectorCopy (spot->s.angles, angles);
|
VectorCopy (spot->s.angles, angles);
|
||||||
|
@ -336,7 +369,6 @@ gentity_t *SelectSpectatorSpawnPoint( vec3_t origin, vec3_t angles ) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=======================================================================
|
=======================================================================
|
||||||
|
|
||||||
|
@ -448,7 +480,6 @@ void CopyToBodyQue( gentity_t *ent ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
body->s.powerups = 0; // clear powerups
|
body->s.powerups = 0; // clear powerups
|
||||||
body->s.loopSound = 0; // clear lava burning
|
body->s.loopSound = 0; // clear lava burning
|
||||||
body->s.number = body - g_entities;
|
body->s.number = body - g_entities;
|
||||||
|
@ -732,12 +763,12 @@ team_t PickTeam( int ignoreClientNum ) {
|
||||||
*/
|
*/
|
||||||
int team;
|
int team;
|
||||||
|
|
||||||
if ( team = LowestTeamCount( ignoreClientNum ) ){
|
if ( (team = LowestTeamCount(ignoreClientNum)) ){
|
||||||
return team;
|
return team;
|
||||||
}
|
}
|
||||||
|
|
||||||
// equal team count, so join the team with the lowest score
|
// equal team count, so join the team with the lowest score
|
||||||
if ( team = LowestTeamScore() ){
|
if ( (team = LowestTeamScore()) ){
|
||||||
return team;
|
return team;
|
||||||
}
|
}
|
||||||
// END
|
// END
|
||||||
|
@ -771,85 +802,63 @@ static void ForceClientSkin( gclient_t *client, char *model, const char *skin )
|
||||||
ClientCheckName
|
ClientCheckName
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
static void ClientCleanName( const char *in, char *out, int outSize ) {
|
static void ClientCleanName(const char *in, char *out, int outSize)
|
||||||
int len, colorlessLen;
|
{
|
||||||
char ch;
|
int outpos = 0, colorlessLen = 0, spaces = 0;
|
||||||
char *p;
|
|
||||||
int spaces;
|
|
||||||
|
|
||||||
//save room for trailing null byte
|
// discard leading spaces
|
||||||
outSize--;
|
for(; *in == ' '; in++);
|
||||||
|
|
||||||
len = 0;
|
for(; *in && outpos < outSize - 1; in++)
|
||||||
colorlessLen = 0;
|
{
|
||||||
p = out;
|
out[outpos] = *in;
|
||||||
*p = 0;
|
|
||||||
spaces = 0;
|
|
||||||
|
|
||||||
while( 1 ) {
|
if(*in == ' ')
|
||||||
ch = *in++;
|
{
|
||||||
if( !ch ) {
|
// don't allow too many consecutive spaces
|
||||||
break;
|
if(spaces > 2)
|
||||||
}
|
|
||||||
|
|
||||||
// don't allow leading spaces
|
|
||||||
if( !*p && ch == ' ' ) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// check colors
|
spaces++;
|
||||||
if( ch == Q_COLOR_ESCAPE ) {
|
|
||||||
// solo trailing carat is not a color prefix
|
|
||||||
if( !*in ) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else if(outpos > 0 && out[outpos - 1] == Q_COLOR_ESCAPE)
|
||||||
|
{
|
||||||
|
if(Q_IsColorString(&out[outpos - 1]))
|
||||||
|
{
|
||||||
|
colorlessLen--;
|
||||||
|
|
||||||
// don't allow black in a name, period
|
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
/*
|
/*
|
||||||
if( ColorIndex(*in) == 0 ) {
|
if(ColorIndex(*in) == 0)
|
||||||
in++;
|
{
|
||||||
|
// Disallow color black in names to prevent players
|
||||||
|
// from getting advantage playing in front of black backgrounds
|
||||||
|
outpos--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// END
|
// END
|
||||||
|
|
||||||
// make sure room in dest for both chars
|
|
||||||
if( len > outSize - 2 ) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
*out++ = ch;
|
{
|
||||||
*out++ = *in++;
|
|
||||||
len += 2;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// don't allow too many consecutive spaces
|
|
||||||
if( ch == ' ' ) {
|
|
||||||
spaces++;
|
|
||||||
if( spaces > 3 ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
spaces = 0;
|
spaces = 0;
|
||||||
}
|
|
||||||
|
|
||||||
if( len > outSize - 1 ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out++ = ch;
|
|
||||||
colorlessLen++;
|
colorlessLen++;
|
||||||
len++;
|
|
||||||
}
|
}
|
||||||
*out = 0;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spaces = 0;
|
||||||
|
colorlessLen++;
|
||||||
|
}
|
||||||
|
|
||||||
|
outpos++;
|
||||||
|
}
|
||||||
|
|
||||||
|
out[outpos] = '\0';
|
||||||
|
|
||||||
// don't allow empty names
|
// don't allow empty names
|
||||||
if( *p == 0 || colorlessLen == 0 ) {
|
if( *out == '\0' || colorlessLen == 0)
|
||||||
Q_strncpyz( p, "UnnamedPlayer", outSize );
|
Q_strncpyz(out, "UnnamedPlayer", outSize );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -986,6 +995,7 @@ void ClientUserinfoChanged( int clientNum ) {
|
||||||
// END
|
// END
|
||||||
|
|
||||||
/* NOTE: all client side now
|
/* NOTE: all client side now
|
||||||
|
|
||||||
// team
|
// team
|
||||||
switch( team ) {
|
switch( team ) {
|
||||||
case TEAM_RED:
|
case TEAM_RED:
|
||||||
|
@ -1081,13 +1091,16 @@ void ClientUserinfoChanged( int clientNum ) {
|
||||||
|
|
||||||
// send over a subset of the userinfo keys so other clients can
|
// send over a subset of the userinfo keys so other clients can
|
||||||
// print scoreboards, display models, and play custom sounds
|
// print scoreboards, display models, and play custom sounds
|
||||||
if ( ent->r.svFlags & SVF_BOT ) {
|
if (ent->r.svFlags & SVF_BOT)
|
||||||
|
{
|
||||||
// STONELANCE - UPDATE: change the userinfo string for bots?
|
// STONELANCE - UPDATE: change the userinfo string for bots?
|
||||||
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",
|
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,
|
client->pers.maxHealth, client->sess.wins, client->sess.losses,
|
||||||
Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader );
|
Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader );
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\rim\\%s\\plate\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\cm\\%i\\ms\\%i\\tt\\%d\\tl\\%d",
|
s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\rim\\%s\\plate\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\cm\\%i\\ms\\%i\\tt\\%d\\tl\\%d",
|
||||||
client->pers.netname, client->sess.sessionTeam, model, headModel, rim, plate, redTeam, blueTeam, c1, c2,
|
client->pers.netname, client->sess.sessionTeam, model, headModel, rim, plate, redTeam, blueTeam, c1, c2,
|
||||||
|
@ -1103,6 +1116,7 @@ void ClientUserinfoChanged( int clientNum ) {
|
||||||
|
|
||||||
trap_SetConfigstring( CS_PLAYERS+clientNum, s );
|
trap_SetConfigstring( CS_PLAYERS+clientNum, s );
|
||||||
|
|
||||||
|
// this is not the userinfo, more like the configstring actually
|
||||||
G_LogPrintf( "ClientUserinfoChanged: %i %s\n", clientNum, s );
|
G_LogPrintf( "ClientUserinfoChanged: %i %s\n", clientNum, s );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1138,14 +1152,20 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
|
||||||
|
|
||||||
trap_GetUserinfo( clientNum, userinfo, sizeof( userinfo ) );
|
trap_GetUserinfo( clientNum, userinfo, sizeof( userinfo ) );
|
||||||
|
|
||||||
|
// IP filtering
|
||||||
|
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=500
|
||||||
|
// recommanding PB based IP / GUID banning, the builtin system is pretty limited
|
||||||
// check to see if they are on the banned IP list
|
// check to see if they are on the banned IP list
|
||||||
value = Info_ValueForKey (userinfo, "ip");
|
value = Info_ValueForKey (userinfo, "ip");
|
||||||
if ( G_FilterPacket( value ) ) {
|
if ( G_FilterPacket( value ) ) {
|
||||||
return "Banned.";
|
return "You are banned from this server.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we don't check password for bots and local client
|
||||||
|
// NOTE: local client <-> "ip" "localhost"
|
||||||
|
// this means this client is not running in our current process
|
||||||
|
if ( !isBot && (strcmp(value, "localhost") != 0)) {
|
||||||
// check for a password
|
// check for a password
|
||||||
if ( !( ent->r.svFlags & SVF_BOT ) ) {
|
|
||||||
value = Info_ValueForKey (userinfo, "password");
|
value = Info_ValueForKey (userinfo, "password");
|
||||||
if ( g_password.string[0] && Q_stricmp( g_password.string, "none" ) &&
|
if ( g_password.string[0] && Q_stricmp( g_password.string, "none" ) &&
|
||||||
strcmp( g_password.string, value) != 0) {
|
strcmp( g_password.string, value) != 0) {
|
||||||
|
@ -1240,6 +1260,7 @@ void ClientBegin( int clientNum ) {
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
ent = g_entities + clientNum;
|
ent = g_entities + clientNum;
|
||||||
|
|
||||||
client = level.clients + clientNum;
|
client = level.clients + clientNum;
|
||||||
|
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
|
@ -1302,6 +1323,7 @@ void ClientBegin( int clientNum ) {
|
||||||
// send event
|
// send event
|
||||||
tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN );
|
tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN );
|
||||||
tent->s.clientNum = ent->s.clientNum;
|
tent->s.clientNum = ent->s.clientNum;
|
||||||
|
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
/*
|
/*
|
||||||
if ( g_gametype.integer != GT_TOURNAMENT ) {
|
if ( g_gametype.integer != GT_TOURNAMENT ) {
|
||||||
|
@ -1350,13 +1372,16 @@ void ClientSpawn(gentity_t *ent) {
|
||||||
index = ent - g_entities;
|
index = ent - g_entities;
|
||||||
client = ent->client;
|
client = ent->client;
|
||||||
|
|
||||||
|
VectorClear(spawn_origin);
|
||||||
|
|
||||||
// find a spawn point
|
// find a spawn point
|
||||||
// do it before setting health back up, so farthest
|
// do it before setting health back up, so farthest
|
||||||
// ranging doesn't count this client
|
// ranging doesn't count this client
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
// if ( client->sess.sessionTeam == TEAM_SPECTATOR ) {
|
// if ( client->sess.sessionTeam == TEAM_SPECTATOR ) {
|
||||||
if ( client->sess.sessionTeam == TEAM_SPECTATOR || isRaceObserver( ent->s.number ) ) {
|
if ( client->sess.sessionTeam == TEAM_SPECTATOR || isRaceObserver( ent->s.number ) ) {
|
||||||
if ( client->sess.spectatorState == SPECTATOR_OBSERVE ){
|
spawnPoint = NULL;
|
||||||
|
if ( client->sess.spectatorState == SPECTATOR_OBSERVE ) {
|
||||||
int clientNum;
|
int clientNum;
|
||||||
|
|
||||||
clientNum = client->sess.spectatorClient;
|
clientNum = client->sess.spectatorClient;
|
||||||
|
@ -1368,59 +1393,51 @@ void ClientSpawn(gentity_t *ent) {
|
||||||
clientNum = level.follow2;
|
clientNum = level.follow2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( clientNum > 0 )
|
if( clientNum >= 0)
|
||||||
FindBestObserverSpot(ent, &g_entities[clientNum], spawn_origin, spawn_angles);
|
spawnPoint = FindBestObserverSpot(ent, &g_entities[clientNum], spawn_origin, spawn_angles);
|
||||||
}
|
}
|
||||||
else
|
if (!spawnPoint)
|
||||||
// END
|
// END
|
||||||
spawnPoint = SelectSpectatorSpawnPoint (
|
spawnPoint = SelectSpectatorSpawnPoint (
|
||||||
spawn_origin, spawn_angles);
|
spawn_origin, spawn_angles);
|
||||||
} else if ( (g_gametype.integer >= GT_CTF) ) {
|
} else if (g_gametype.integer >= GT_CTF ) {
|
||||||
// all base oriented team games use the CTF spawn points
|
// all base oriented team games use the CTF spawn points
|
||||||
spawnPoint = SelectCTFSpawnPoint (
|
spawnPoint = SelectCTFSpawnPoint (
|
||||||
client->sess.sessionTeam,
|
client->sess.sessionTeam,
|
||||||
client->pers.teamState.state,
|
client->pers.teamState.state,
|
||||||
spawn_origin, spawn_angles);
|
spawn_origin, spawn_angles,
|
||||||
} else {
|
!!(ent->r.svFlags & SVF_BOT));
|
||||||
do {
|
}
|
||||||
// the first spawn should be at a good looking spot
|
else
|
||||||
|
{
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
if (isRallyRace()){
|
if (isRallyRace()) {
|
||||||
// respawn at the grid if the race just started to stop people from
|
// respawn at the grid if the race just started to stop people from
|
||||||
// killing themselves inorder to get ahead at the beginning
|
// killing themselves inorder to get ahead at the beginning
|
||||||
if ( level.startRaceTime && level.time - level.startRaceTime > 1000 )
|
if ( level.startRaceTime && level.time - level.startRaceTime > 1000 )
|
||||||
spawnPoint = SelectLastMarkerForSpawn(ent, spawn_origin, spawn_angles);
|
spawnPoint = SelectLastMarkerForSpawn(ent, spawn_origin, spawn_angles, !!(ent->r.svFlags & SVF_BOT));
|
||||||
else
|
else
|
||||||
spawnPoint = SelectGridPositionSpawn(ent, spawn_origin, spawn_angles);
|
spawnPoint = SelectGridPositionSpawn(ent, spawn_origin, spawn_angles, !!(ent->r.svFlags & SVF_BOT));
|
||||||
|
|
||||||
if (g_trackReversed.integer && level.trackIsReversable){
|
if (g_trackReversed.integer && level.trackIsReversable){
|
||||||
spawn_angles[YAW] += 180;
|
spawn_angles[YAW] += 180;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
// END
|
// END
|
||||||
if ( !client->pers.initialSpawn && client->pers.localClient ) {
|
// the first spawn should be at a good looking spot
|
||||||
|
if ( !client->pers.initialSpawn && client->pers.localClient )
|
||||||
|
{
|
||||||
client->pers.initialSpawn = qtrue;
|
client->pers.initialSpawn = qtrue;
|
||||||
spawnPoint = SelectInitialSpawnPoint( spawn_origin, spawn_angles );
|
spawnPoint = SelectInitialSpawnPoint(spawn_origin, spawn_angles,
|
||||||
} else {
|
!!(ent->r.svFlags & SVF_BOT));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// don't spawn near existing origin if possible
|
// don't spawn near existing origin if possible
|
||||||
spawnPoint = SelectSpawnPoint (
|
spawnPoint = SelectSpawnPoint (
|
||||||
client->ps.origin,
|
client->ps.origin,
|
||||||
spawn_origin, spawn_angles);
|
spawn_origin, spawn_angles, !!(ent->r.svFlags & SVF_BOT));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tim needs to prevent bots from spawning at the initial point
|
|
||||||
// on q3dm0...
|
|
||||||
if ( ( spawnPoint->flags & FL_NO_BOTS ) && ( ent->r.svFlags & SVF_BOT ) ) {
|
|
||||||
continue; // try again
|
|
||||||
}
|
|
||||||
// just to be symetric, we have a nohumans option...
|
|
||||||
if ( ( spawnPoint->flags & FL_NO_HUMANS ) && !( ent->r.svFlags & SVF_BOT ) ) {
|
|
||||||
continue; // try again
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
} while ( 1 );
|
|
||||||
}
|
}
|
||||||
client->pers.teamState.state = TEAM_ACTIVE;
|
client->pers.teamState.state = TEAM_ACTIVE;
|
||||||
|
|
||||||
|
@ -1464,7 +1481,7 @@ void ClientSpawn(gentity_t *ent) {
|
||||||
*/
|
*/
|
||||||
// END
|
// END
|
||||||
|
|
||||||
memset (client, 0, sizeof(*client)); // bk FIXME: Com_Memset?
|
Com_Memset (client, 0, sizeof(*client));
|
||||||
|
|
||||||
client->pers = saved;
|
client->pers = saved;
|
||||||
client->sess = savedSess;
|
client->sess = savedSess;
|
||||||
|
|
|
@ -1811,7 +1811,7 @@ void Cmd_Stats_f( gentity_t *ent ) {
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
void Cmd_SaveBPoints_f( gentity_t *other )
|
void Cmd_SaveBPoints_f( gentity_t *other )
|
||||||
{
|
{
|
||||||
int i, j;
|
int i;
|
||||||
fileHandle_t f;
|
fileHandle_t f;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
char serverinfo[MAX_INFO_STRING];
|
char serverinfo[MAX_INFO_STRING];
|
||||||
|
|
|
@ -1414,12 +1414,12 @@ qboolean G_RadiusDamage_NoKnockBack ( vec3_t origin, gentity_t *attacker, float
|
||||||
int entityList[MAX_GENTITIES];
|
int entityList[MAX_GENTITIES];
|
||||||
int numListedEntities;
|
int numListedEntities;
|
||||||
vec3_t mins, maxs;
|
vec3_t mins, maxs;
|
||||||
vec3_t v;
|
// vec3_t v;
|
||||||
// vec3_t dir;
|
// vec3_t dir;
|
||||||
int i, e;
|
int i, e;
|
||||||
qboolean hitClient = qfalse;
|
qboolean hitClient = qfalse;
|
||||||
vec3_t o;
|
// vec3_t o;
|
||||||
float minDist;
|
// float minDist;
|
||||||
|
|
||||||
if ( radius < 1 ) {
|
if ( radius < 1 ) {
|
||||||
radius = 1;
|
radius = 1;
|
||||||
|
|
|
@ -606,7 +606,7 @@ void G_AddPredictableEvent( gentity_t *ent, int event, int eventParm );
|
||||||
void G_AddEvent( gentity_t *ent, int event, int eventParm );
|
void G_AddEvent( gentity_t *ent, int event, int eventParm );
|
||||||
void G_SetOrigin( gentity_t *ent, vec3_t origin );
|
void G_SetOrigin( gentity_t *ent, vec3_t origin );
|
||||||
void AddRemap(const char *oldShader, const char *newShader, float timeOffset);
|
void AddRemap(const char *oldShader, const char *newShader, float timeOffset);
|
||||||
const char *BuildShaderStateConfig();
|
const char *BuildShaderStateConfig( void );
|
||||||
|
|
||||||
//
|
//
|
||||||
// g_combat.c
|
// g_combat.c
|
||||||
|
@ -614,6 +614,10 @@ const char *BuildShaderStateConfig();
|
||||||
qboolean CanDamage (gentity_t *targ, vec3_t origin);
|
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);
|
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);
|
qboolean G_RadiusDamage (vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, int mod);
|
||||||
|
// STONELANCE
|
||||||
|
qboolean G_RadiusDamage_NoKnockBack ( vec3_t origin, gentity_t *attacker, float damage, float radius,
|
||||||
|
gentity_t *ignore, int mod);
|
||||||
|
// END
|
||||||
int G_InvulnerabilityEffect( gentity_t *targ, vec3_t dir, vec3_t point, vec3_t impactpoint, vec3_t bouncedir );
|
int G_InvulnerabilityEffect( gentity_t *targ, vec3_t dir, vec3_t point, vec3_t impactpoint, vec3_t bouncedir );
|
||||||
void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath );
|
void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath );
|
||||||
void TossClientItems( gentity_t *self );
|
void TossClientItems( gentity_t *self );
|
||||||
|
@ -709,7 +713,7 @@ team_t TeamCount( int ignoreClientNum, int team );
|
||||||
int TeamLeader( int team );
|
int TeamLeader( int team );
|
||||||
team_t PickTeam( int ignoreClientNum );
|
team_t PickTeam( int ignoreClientNum );
|
||||||
void SetClientViewAngle( gentity_t *ent, vec3_t angle );
|
void SetClientViewAngle( gentity_t *ent, vec3_t angle );
|
||||||
gentity_t *SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles );
|
gentity_t *SelectSpawnPoint (vec3_t avoidPoint, vec3_t origin, vec3_t angles, qboolean isbot);
|
||||||
void CopyToBodyQue( gentity_t *ent );
|
void CopyToBodyQue( gentity_t *ent );
|
||||||
void respawn (gentity_t *ent);
|
void respawn (gentity_t *ent);
|
||||||
void BeginIntermission (void);
|
void BeginIntermission (void);
|
||||||
|
@ -749,7 +753,7 @@ void G_StartKamikaze( gentity_t *ent );
|
||||||
#define OBSERVERCAM_ZOOM 1
|
#define OBSERVERCAM_ZOOM 1
|
||||||
#define OBSERVERCAM_FIXED 2
|
#define OBSERVERCAM_FIXED 2
|
||||||
|
|
||||||
qboolean FindBestObserverSpot( gentity_t *self, gentity_t *target, vec3_t spot, vec3_t angles);
|
gentity_t *FindBestObserverSpot( gentity_t *self, gentity_t *target, vec3_t spot, vec3_t angles);
|
||||||
void UpdateObserverSpot( gentity_t *ent, qboolean forceUpdate );
|
void UpdateObserverSpot( gentity_t *ent, qboolean forceUpdate );
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -782,8 +786,8 @@ void CreateRallyStarter( void );
|
||||||
void CalculatePlayerPositions( void );
|
void CalculatePlayerPositions( void );
|
||||||
void Cmd_RacePositions_f( void );
|
void Cmd_RacePositions_f( void );
|
||||||
void Cmd_Times_f( gentity_t *ent );
|
void Cmd_Times_f( gentity_t *ent );
|
||||||
gentity_t *SelectLastMarkerForSpawn( gentity_t *ent, vec3_t origin, vec3_t angles );
|
gentity_t *SelectLastMarkerForSpawn( gentity_t *ent, vec3_t origin, vec3_t angles, qboolean isbot );
|
||||||
gentity_t *SelectGridPositionSpawn( gentity_t *ent, vec3_t origin, vec3_t angles );
|
gentity_t *SelectGridPositionSpawn( gentity_t *ent, vec3_t origin, vec3_t angles, qboolean isbot );
|
||||||
|
|
||||||
//
|
//
|
||||||
// g_rally_rearweapon.c
|
// g_rally_rearweapon.c
|
||||||
|
@ -798,6 +802,8 @@ void CreateBioHazard (gentity_t *owner, vec3_t origin);
|
||||||
void CheckForOil(vec3_t origin, float radius);
|
void CheckForOil(vec3_t origin, float radius);
|
||||||
void CreateOilHazard (gentity_t *owner, vec3_t origin);
|
void CreateOilHazard (gentity_t *owner, vec3_t origin);
|
||||||
void CreatePoisonHazard (gentity_t *owner, vec3_t origin);
|
void CreatePoisonHazard (gentity_t *owner, vec3_t origin);
|
||||||
|
void CreatePoisonCloudHazard (gentity_t *owner, vec3_t origin);
|
||||||
|
void CreateSmokeHazard (gentity_t *owner, vec3_t origin);
|
||||||
// END
|
// END
|
||||||
|
|
||||||
|
|
||||||
|
@ -840,6 +846,9 @@ void ClientUserinfoChanged( int clientNum );
|
||||||
void ClientDisconnect( int clientNum );
|
void ClientDisconnect( int clientNum );
|
||||||
void ClientBegin( int clientNum );
|
void ClientBegin( int clientNum );
|
||||||
void ClientCommand( int clientNum );
|
void ClientCommand( int clientNum );
|
||||||
|
// STONELANCE
|
||||||
|
gentity_t *SelectSpectatorSpawnPoint( vec3_t origin, vec3_t angles );
|
||||||
|
// END
|
||||||
|
|
||||||
//
|
//
|
||||||
// g_active.c
|
// g_active.c
|
||||||
|
|
|
@ -1158,7 +1158,7 @@ void FindIntermissionPoint( void ) {
|
||||||
// find the intermission spot
|
// find the intermission spot
|
||||||
ent = G_Find (NULL, FOFS(classname), "info_player_intermission");
|
ent = G_Find (NULL, FOFS(classname), "info_player_intermission");
|
||||||
if ( !ent ) { // the map creator forgot to put in an intermission point...
|
if ( !ent ) { // the map creator forgot to put in an intermission point...
|
||||||
SelectSpawnPoint ( vec3_origin, level.intermission_origin, level.intermission_angle );
|
SelectSpawnPoint ( vec3_origin, level.intermission_origin, level.intermission_angle, qfalse );
|
||||||
} else {
|
} else {
|
||||||
VectorCopy (ent->s.origin, level.intermission_origin);
|
VectorCopy (ent->s.origin, level.intermission_origin);
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
|
@ -1229,6 +1229,7 @@ void BeginIntermission( void ) {
|
||||||
|
|
||||||
// send the current scoring to all clients
|
// send the current scoring to all clients
|
||||||
SendScoreboardMessageToAllClients();
|
SendScoreboardMessageToAllClients();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1244,6 +1245,8 @@ or moved to a new level based on the "nextmap" cvar
|
||||||
void ExitLevel (void) {
|
void ExitLevel (void) {
|
||||||
int i;
|
int i;
|
||||||
gclient_t *cl;
|
gclient_t *cl;
|
||||||
|
char nextmap[MAX_STRING_CHARS];
|
||||||
|
char d1[MAX_STRING_CHARS];
|
||||||
|
|
||||||
//bot interbreeding
|
//bot interbreeding
|
||||||
BotInterbreedEndMatch();
|
BotInterbreedEndMatch();
|
||||||
|
@ -1265,7 +1268,16 @@ void ExitLevel (void) {
|
||||||
*/
|
*/
|
||||||
// END
|
// END
|
||||||
|
|
||||||
|
trap_Cvar_VariableStringBuffer( "nextmap", nextmap, sizeof(nextmap) );
|
||||||
|
trap_Cvar_VariableStringBuffer( "d1", d1, sizeof(d1) );
|
||||||
|
|
||||||
|
if( !Q_stricmp( nextmap, "map_restart 0" ) && Q_stricmp( d1, "" ) ) {
|
||||||
|
trap_Cvar_Set( "nextmap", "vstr d2" );
|
||||||
|
trap_SendConsoleCommand( EXEC_APPEND, "vstr d1\n" );
|
||||||
|
} else {
|
||||||
trap_SendConsoleCommand( EXEC_APPEND, "vstr nextmap\n" );
|
trap_SendConsoleCommand( EXEC_APPEND, "vstr nextmap\n" );
|
||||||
|
}
|
||||||
|
|
||||||
level.changemap = NULL;
|
level.changemap = NULL;
|
||||||
level.intermissiontime = 0;
|
level.intermissiontime = 0;
|
||||||
|
|
||||||
|
@ -1319,7 +1331,7 @@ void QDECL G_LogPrintf( const char *fmt, ... ) {
|
||||||
Com_sprintf( string, sizeof(string), "%3i:%i%i ", min, tens, sec );
|
Com_sprintf( string, sizeof(string), "%3i:%i%i ", min, tens, sec );
|
||||||
|
|
||||||
va_start( argptr, fmt );
|
va_start( argptr, fmt );
|
||||||
Q_vsnprintf (string+7, sizeof(string)-7, fmt, argptr);
|
Q_vsnprintf(string + 7, sizeof(string) - 7, fmt, argptr);
|
||||||
va_end( argptr );
|
va_end( argptr );
|
||||||
|
|
||||||
if ( g_dedicated.integer ) {
|
if ( g_dedicated.integer ) {
|
||||||
|
@ -1378,10 +1390,9 @@ Append information about this game to the log file
|
||||||
void LogExit( const char *string ) {
|
void LogExit( const char *string ) {
|
||||||
int i, numSorted;
|
int i, numSorted;
|
||||||
gclient_t *cl;
|
gclient_t *cl;
|
||||||
#ifdef MISSIONPACK // bk001205
|
#ifdef MISSIONPACK
|
||||||
qboolean won = qtrue;
|
qboolean won = qtrue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
G_LogPrintf( "Exit: %s\n", string );
|
G_LogPrintf( "Exit: %s\n", string );
|
||||||
|
|
||||||
level.intermissionQueued = level.time;
|
level.intermissionQueued = level.time;
|
||||||
|
@ -1623,7 +1634,6 @@ void CheckExitRules( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for sudden death
|
// check for sudden death
|
||||||
|
|
||||||
if ( ScoreIsTied() ) {
|
if ( ScoreIsTied() ) {
|
||||||
// always wait for sudden death
|
// always wait for sudden death
|
||||||
return;
|
return;
|
||||||
|
@ -1638,8 +1648,8 @@ void CheckExitRules( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// STONELANCE
|
// STONELANCE
|
||||||
if (g_gametype.integer == GT_DERBY && level.startRaceTime && !level.finishRaceTime){
|
if (g_gametype.integer == GT_DERBY && level.startRaceTime && !level.finishRaceTime) {
|
||||||
gclient_t *winner;
|
gclient_t *winner = NULL;
|
||||||
|
|
||||||
for ( i=0, count = 0 ; i< g_maxclients.integer ; i++ ) {
|
for ( i=0, count = 0 ; i< g_maxclients.integer ; i++ ) {
|
||||||
cl = level.clients + i;
|
cl = level.clients + i;
|
||||||
|
@ -1652,7 +1662,7 @@ void CheckExitRules( void ) {
|
||||||
winner = cl;
|
winner = cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 1){
|
if (winner && count == 1) {
|
||||||
level.winnerNumber = winner->ps.clientNum;
|
level.winnerNumber = winner->ps.clientNum;
|
||||||
level.finishRaceTime = level.time;
|
level.finishRaceTime = level.time;
|
||||||
|
|
||||||
|
|
|
@ -765,5 +765,4 @@ void G_BREAKWOOD(gentity_t *ent, vec3_t point, int mod) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,6 @@ void CreateBioHazard (gentity_t *owner, vec3_t origin){
|
||||||
gentity_t *ent;
|
gentity_t *ent;
|
||||||
gentity_t *other;
|
gentity_t *other;
|
||||||
vec3_t dist;
|
vec3_t dist;
|
||||||
vec3_t snapped;
|
|
||||||
int highest;
|
int highest;
|
||||||
|
|
||||||
other = NULL;
|
other = NULL;
|
||||||
|
@ -355,7 +354,7 @@ CreatePoisonCloudHazard
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CreatePoisonCloudHazard (gentity_t *owner, vec3_t origin){
|
void CreatePoisonCloudHazard (gentity_t *owner, vec3_t origin) {
|
||||||
gentity_t *ent;
|
gentity_t *ent;
|
||||||
|
|
||||||
ent = G_TempEntity( origin, EV_HAZARD );
|
ent = G_TempEntity( origin, EV_HAZARD );
|
||||||
|
@ -374,7 +373,7 @@ CreateSmokeHazard
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CreateSmokeHazard (gentity_t *owner, vec3_t origin){
|
void CreateSmokeHazard (gentity_t *owner, vec3_t origin) {
|
||||||
gentity_t *ent;
|
gentity_t *ent;
|
||||||
|
|
||||||
ent = G_TempEntity( origin, EV_HAZARD );
|
ent = G_TempEntity( origin, EV_HAZARD );
|
||||||
|
|
|
@ -91,6 +91,7 @@ void Touch_StartFinish (gentity_t *self, gentity_t *other, trace_t *trace ){
|
||||||
place = "eighth";
|
place = "eighth";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
place = NULL;
|
||||||
Com_Printf( "Unknown placing: %i\n", other->client->ps.stats[STAT_POSITION] );
|
Com_Printf( "Unknown placing: %i\n", other->client->ps.stats[STAT_POSITION] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -181,7 +182,7 @@ void SP_rally_startfinish( gentity_t *ent ) {
|
||||||
|
|
||||||
if (!g_laplimit.integer){
|
if (!g_laplimit.integer){
|
||||||
level.numberOfLaps = ent->laps;
|
level.numberOfLaps = ent->laps;
|
||||||
trap_Cvar_Set( "laplimit", va("%s", level.numberOfLaps) );
|
trap_Cvar_Set( "laplimit", va("%d", level.numberOfLaps) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
level.numberOfLaps = g_laplimit.integer;
|
level.numberOfLaps = g_laplimit.integer;
|
||||||
|
|
|
@ -34,16 +34,16 @@ void SP_info_observer_spot( gentity_t *ent ){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
qboolean FindBestObserverSpot( gentity_t *self, gentity_t *target, vec3_t spot, vec3_t angles){
|
gentity_t *FindBestObserverSpot( gentity_t *self, gentity_t *target, vec3_t spot, vec3_t angles){
|
||||||
gentity_t *ent;
|
gentity_t *ent;
|
||||||
trace_t tr;
|
trace_t tr;
|
||||||
vec3_t delta;
|
vec3_t delta;
|
||||||
static vec3_t mins = { -4, -4, -4 };
|
static vec3_t mins = { -4, -4, -4 };
|
||||||
static vec3_t maxs = { 4, 4, 4 };
|
static vec3_t maxs = { 4, 4, 4 };
|
||||||
float dist, bestDist;
|
float dist, bestDist;
|
||||||
qboolean foundSpot;
|
gentity_t *foundSpot;
|
||||||
|
|
||||||
foundSpot = qfalse;
|
foundSpot = NULL;
|
||||||
dist = 0;
|
dist = 0;
|
||||||
bestDist = 0;
|
bestDist = 0;
|
||||||
ent = NULL;
|
ent = NULL;
|
||||||
|
@ -53,7 +53,7 @@ qboolean FindBestObserverSpot( gentity_t *self, gentity_t *target, vec3_t spot,
|
||||||
|
|
||||||
// Com_Printf("Found an observer spot in PVS\n");
|
// Com_Printf("Found an observer spot in PVS\n");
|
||||||
// VectorCopy(ent->s.origin, spot);
|
// VectorCopy(ent->s.origin, spot);
|
||||||
// foundSpot = qtrue;
|
// foundSpot = ent;
|
||||||
// return foundSpot;
|
// return foundSpot;
|
||||||
|
|
||||||
trap_Trace(&tr, ent->r.currentOrigin, mins, maxs, target->client->ps.origin, target->s.number, CONTENTS_SOLID);
|
trap_Trace(&tr, ent->r.currentOrigin, mins, maxs, target->client->ps.origin, target->s.number, CONTENTS_SOLID);
|
||||||
|
@ -77,7 +77,7 @@ qboolean FindBestObserverSpot( gentity_t *self, gentity_t *target, vec3_t spot,
|
||||||
self->spotflags = ent->spawnflags;
|
self->spotflags = ent->spawnflags;
|
||||||
|
|
||||||
// use this one
|
// use this one
|
||||||
return qtrue;
|
return ent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ qboolean FindBestObserverSpot( gentity_t *self, gentity_t *target, vec3_t spot,
|
||||||
|
|
||||||
// Com_Printf("Found a valid observer spot\n");
|
// Com_Printf("Found a valid observer spot\n");
|
||||||
self->spotflags = ent->spawnflags;
|
self->spotflags = ent->spawnflags;
|
||||||
foundSpot = qtrue;
|
foundSpot = ent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,8 +265,7 @@ void CalculatePlayerPositions( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
positionChanged = qfalse;
|
positionChanged = qfalse;
|
||||||
leader = NULL;
|
leader = ent = last = NULL;
|
||||||
ent = NULL;
|
|
||||||
while ( (ent = G_Find (ent, FOFS(classname), "player")) != NULL )
|
while ( (ent = G_Find (ent, FOFS(classname), "player")) != NULL )
|
||||||
{
|
{
|
||||||
if ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) continue;
|
if ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) continue;
|
||||||
|
@ -307,8 +306,10 @@ void CalculatePlayerPositions( void )
|
||||||
{
|
{
|
||||||
// cur->carBehind = NULL;
|
// cur->carBehind = NULL;
|
||||||
ent->carBehind = cur;
|
ent->carBehind = cur;
|
||||||
|
if (last) {
|
||||||
last->carBehind = ent;
|
last->carBehind = ent;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
cur->carBehind = ent;
|
cur->carBehind = ent;
|
||||||
ent->carBehind = NULL;
|
ent->carBehind = NULL;
|
||||||
|
@ -481,7 +482,7 @@ SelectLastMarkerForSpawn
|
||||||
|
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
gentity_t *SelectLastMarkerForSpawn( gentity_t *ent, vec3_t origin, vec3_t angles ) {
|
gentity_t *SelectLastMarkerForSpawn( gentity_t *ent, vec3_t origin, vec3_t angles, qboolean isbot ) {
|
||||||
gentity_t *spot;
|
gentity_t *spot;
|
||||||
int lastMarker;
|
int lastMarker;
|
||||||
|
|
||||||
|
@ -498,7 +499,7 @@ gentity_t *SelectLastMarkerForSpawn( gentity_t *ent, vec3_t origin, vec3_t angle
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !spot ) {
|
if ( !spot ) {
|
||||||
return SelectSpawnPoint( vec3_origin, origin, angles );
|
return SelectSpawnPoint( vec3_origin, origin, angles, isbot );
|
||||||
}
|
}
|
||||||
|
|
||||||
// spawn at last checkpoint
|
// spawn at last checkpoint
|
||||||
|
@ -516,7 +517,7 @@ SelectGridPositionSpawn
|
||||||
|
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
gentity_t *SelectGridPositionSpawn( gentity_t *ent, vec3_t origin, vec3_t angles ) {
|
gentity_t *SelectGridPositionSpawn( gentity_t *ent, vec3_t origin, vec3_t angles, qboolean isbot ) {
|
||||||
gentity_t *spot;
|
gentity_t *spot;
|
||||||
int gridPosition;
|
int gridPosition;
|
||||||
|
|
||||||
|
@ -535,7 +536,7 @@ gentity_t *SelectGridPositionSpawn( gentity_t *ent, vec3_t origin, vec3_t angles
|
||||||
if ( !spot || SpotWouldTelefrag( spot ) ) {
|
if ( !spot || SpotWouldTelefrag( spot ) ) {
|
||||||
// FIXME: put into spectator mode instead?
|
// FIXME: put into spectator mode instead?
|
||||||
G_Printf("Warning: No info_player_start found for race spawn, trying info_player_deathmatch\n");
|
G_Printf("Warning: No info_player_start found for race spawn, trying info_player_deathmatch\n");
|
||||||
return SelectSpawnPoint( vec3_origin, origin, angles );
|
return SelectSpawnPoint( vec3_origin, origin, angles, isbot );
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorCopy (spot->s.origin, origin);
|
VectorCopy (spot->s.origin, origin);
|
||||||
|
|
|
@ -75,8 +75,8 @@ qboolean G_ParseScriptedObject( gentity_t *ent ){
|
||||||
char *token;
|
char *token;
|
||||||
char text[MAX_SCRIPT_TEXT];
|
char text[MAX_SCRIPT_TEXT];
|
||||||
char filename[MAX_QPATH];
|
char filename[MAX_QPATH];
|
||||||
char model[MAX_QPATH];
|
// char model[MAX_QPATH];
|
||||||
char deadmodel[MAX_QPATH];
|
// char deadmodel[MAX_QPATH];
|
||||||
fileHandle_t f;
|
fileHandle_t f;
|
||||||
|
|
||||||
// setup defaults
|
// setup defaults
|
||||||
|
@ -298,9 +298,8 @@ qboolean G_ScriptedObject_ApplyCollision( gentity_t *self, vec3_t at, vec3_t nor
|
||||||
vec3_t arm;
|
vec3_t arm;
|
||||||
vec3_t vP1;
|
vec3_t vP1;
|
||||||
vec3_t impulse, impulseMoment;
|
vec3_t impulse, impulseMoment;
|
||||||
vec3_t delta, cross, cross2;
|
vec3_t cross, cross2;
|
||||||
float impulseNum, oppositeImpulseNum, impulseDen, dot;
|
float impulseNum, oppositeImpulseNum, impulseDen, dot;
|
||||||
int i;
|
|
||||||
|
|
||||||
// temp for inverseWorldInertiaTensor
|
// temp for inverseWorldInertiaTensor
|
||||||
vec3_t axis[3];
|
vec3_t axis[3];
|
||||||
|
|
|
@ -101,7 +101,7 @@ G_ResetCar
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void G_ResetCar( gentity_t *ent ) {
|
void G_ResetCar( gentity_t *ent ) {
|
||||||
int i;
|
// int i;
|
||||||
vec3_t origin, end, angles;
|
vec3_t origin, end, angles;
|
||||||
vec3_t mins, maxs;
|
vec3_t mins, maxs;
|
||||||
trace_t tr;
|
trace_t tr;
|
||||||
|
|
|
@ -35,7 +35,6 @@ typedef struct teamgame_s {
|
||||||
int blueTakenTime;
|
int blueTakenTime;
|
||||||
int redObeliskAttackedTime;
|
int redObeliskAttackedTime;
|
||||||
int blueObeliskAttackedTime;
|
int blueObeliskAttackedTime;
|
||||||
|
|
||||||
} teamgame_t;
|
} teamgame_t;
|
||||||
|
|
||||||
teamgame_t teamgame;
|
teamgame_t teamgame;
|
||||||
|
@ -44,18 +43,16 @@ gentity_t *neutralObelisk;
|
||||||
|
|
||||||
void Team_SetFlagStatus( int team, flagStatus_t status );
|
void Team_SetFlagStatus( int team, flagStatus_t status );
|
||||||
|
|
||||||
|
|
||||||
void Team_InitGame( void ) {
|
void Team_InitGame( void ) {
|
||||||
memset(&teamgame, 0, sizeof teamgame);
|
memset(&teamgame, 0, sizeof teamgame);
|
||||||
|
|
||||||
switch( g_gametype.integer ) {
|
switch( g_gametype.integer ) {
|
||||||
case GT_CTF:
|
case GT_CTF:
|
||||||
teamgame.redStatus = teamgame.blueStatus = -1; // Invalid to force update
|
teamgame.redStatus = -1; // Invalid to force update
|
||||||
Team_SetFlagStatus( TEAM_RED, FLAG_ATBASE );
|
Team_SetFlagStatus( TEAM_RED, FLAG_ATBASE );
|
||||||
|
teamgame.blueStatus = -1; // Invalid to force update
|
||||||
Team_SetFlagStatus( TEAM_BLUE, FLAG_ATBASE );
|
Team_SetFlagStatus( TEAM_BLUE, FLAG_ATBASE );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
case GT_1FCTF:
|
case GT_1FCTF:
|
||||||
teamgame.flagStatus = -1; // Invalid to force update
|
teamgame.flagStatus = -1; // Invalid to force update
|
||||||
|
@ -209,8 +206,6 @@ qboolean OnSameTeam( gentity_t *ent1, gentity_t *ent2 ) {
|
||||||
static char ctfFlagStatusRemap[] = { '0', '1', '*', '*', '2' };
|
static char ctfFlagStatusRemap[] = { '0', '1', '*', '*', '2' };
|
||||||
static char oneFlagStatusRemap[] = { '0', '1', '2', '3', '4' };
|
static char oneFlagStatusRemap[] = { '0', '1', '2', '3', '4' };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Team_SetFlagStatus( int team, flagStatus_t status ) {
|
void Team_SetFlagStatus( int team, flagStatus_t status ) {
|
||||||
qboolean modified = qfalse;
|
qboolean modified = qfalse;
|
||||||
|
|
||||||
|
@ -1053,13 +1048,13 @@ SelectCTFSpawnPoint
|
||||||
|
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles ) {
|
gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles, qboolean isbot ) {
|
||||||
gentity_t *spot;
|
gentity_t *spot;
|
||||||
|
|
||||||
spot = SelectRandomTeamSpawnPoint ( teamstate, team );
|
spot = SelectRandomTeamSpawnPoint ( teamstate, team );
|
||||||
|
|
||||||
if (!spot) {
|
if (!spot) {
|
||||||
return SelectSpawnPoint( vec3_origin, origin, angles );
|
return SelectSpawnPoint( vec3_origin, origin, angles, isbot );
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorCopy (spot->s.origin, origin);
|
VectorCopy (spot->s.origin, origin);
|
||||||
|
@ -1132,7 +1127,7 @@ void TeamplayInfoMessage( gentity_t *ent ) {
|
||||||
i, player->client->pers.teamState.location, h, a,
|
i, player->client->pers.teamState.location, h, a,
|
||||||
player->client->ps.weapon, player->s.powerups);
|
player->client->ps.weapon, player->s.powerups);
|
||||||
j = strlen(entry);
|
j = strlen(entry);
|
||||||
if (stringlength + j > sizeof(string))
|
if (stringlength + j >= sizeof(string))
|
||||||
break;
|
break;
|
||||||
strcpy (string + stringlength, entry);
|
strcpy (string + stringlength, entry);
|
||||||
stringlength += j;
|
stringlength += j;
|
||||||
|
@ -1516,4 +1511,3 @@ qboolean CheckObeliskAttack( gentity_t *obelisk, gentity_t *attacker ) {
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -80,12 +80,10 @@ void Team_CheckHurtCarrier(gentity_t *targ, gentity_t *attacker);
|
||||||
void Team_InitGame(void);
|
void Team_InitGame(void);
|
||||||
void Team_ReturnFlag(int team);
|
void Team_ReturnFlag(int team);
|
||||||
void Team_FreeEntity(gentity_t *ent);
|
void Team_FreeEntity(gentity_t *ent);
|
||||||
gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles );
|
gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles, qboolean isbot );
|
||||||
gentity_t *Team_GetLocation(gentity_t *ent);
|
gentity_t *Team_GetLocation(gentity_t *ent);
|
||||||
qboolean Team_GetLocationMsg(gentity_t *ent, char *loc, int loclen);
|
qboolean Team_GetLocationMsg(gentity_t *ent, char *loc, int loclen);
|
||||||
void TeamplayInfoMessage( gentity_t *ent );
|
void TeamplayInfoMessage( gentity_t *ent );
|
||||||
void CheckTeamStatus(void);
|
void CheckTeamStatus(void);
|
||||||
|
|
||||||
int Pickup_Team( gentity_t *ent, gentity_t *other );
|
int Pickup_Team( gentity_t *ent, gentity_t *other );
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -560,7 +560,8 @@ plasma circles around player similar to AltFire Mod
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Weapon_Plasmagun_Circular_Fire (gentity_t *ent) {
|
void Weapon_Plasmagun_Circular_Fire (gentity_t *ent) {
|
||||||
gentity_t *m, *n;
|
gentity_t *m;
|
||||||
|
// gentity_t *n;
|
||||||
vec3_t temp, temp2;
|
vec3_t temp, temp2;
|
||||||
|
|
||||||
//forward[0] += (float)sin( m->s.pos.trTime / m->s.pos.trDuration );
|
//forward[0] += (float)sin( m->s.pos.trTime / m->s.pos.trDuration );
|
||||||
|
|
Loading…
Reference in a new issue