summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_misc.c13
-rw-r--r--src/game/bg_pmove.c3
-rw-r--r--src/game/bg_public.h10
-rw-r--r--src/game/g_active.c62
-rw-r--r--src/game/g_buildable.c4
-rw-r--r--src/game/g_client.c22
-rw-r--r--src/game/g_cmds.c82
-rw-r--r--src/game/g_combat.c23
-rw-r--r--src/game/g_local.h7
-rw-r--r--src/game/g_main.c4
-rw-r--r--src/game/g_ptr.c38
-rw-r--r--src/game/g_svcmds.c3
-rw-r--r--src/game/g_team.c3
-rw-r--r--src/game/g_weapon.c5
14 files changed, 127 insertions, 152 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 79bdb09f..3de02f9b 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -2055,10 +2055,9 @@ static const weaponAttributes_t bg_weapons[ ] =
SLOT_WEAPON, //int slots;
"mdriver", //char *weaponName;
"Mass Driver", //char *humanName;
- "A portable magnetic accelerator capable of launching "
- "metallic slugs at extremely high velocity. Damage is dealt to "
- "all targets in the line of fire until the slug comes to a halt "
- "within a wall.",
+ "A portable particle accelerator which causes minor nuclear "
+ "reactions at the point of impact. It has a very large "
+ "payload, but fires slowly.",
MDRIVER_CLIPSIZE, //int maxAmmo;
MDRIVER_MAXCLIPS, //int maxClips;
qfalse, //int infiniteAmmo;
@@ -3096,7 +3095,7 @@ qboolean BG_WeaponIsFull( weapon_t weapon, int stats[ ], int ammo, int clips )
maxClips = BG_Weapon( weapon )->maxClips;
if( BG_InventoryContainsUpgrade( UP_BATTPACK, stats ) )
- maxAmmo *= BATTPACK_MODIFIER;
+ maxAmmo = (int)( (float)maxAmmo * BATTPACK_MODIFIER );
return ( maxAmmo == ammo ) && ( maxClips == clips );
}
@@ -3418,9 +3417,9 @@ Only needs to be used for human weapons.
*/
weapon_t BG_GetPlayerWeapon( playerState_t *ps )
{
- if( ps->persistant[ PERS_NEWWEAPON ] &&
- ps->persistant[ PERS_NEWWEAPON ] != ps->weapon )
+ if( ps->persistant[ PERS_NEWWEAPON ] )
return ps->persistant[ PERS_NEWWEAPON ];
+
return ps->weapon;
}
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 5ac711ad..0a6f1923 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -790,7 +790,6 @@ static qboolean PM_CheckJump( void )
if( pm->ps->pm_type == PM_GRABBED )
{
pm->cmd.upmove = 0;
- // not holding jump
return qfalse;
}
@@ -3681,7 +3680,7 @@ void PmoveSingle( pmove_t *pmove )
if( pm->cmd.upmove < 10 )
{
- // not holding jump or minijump
+ // not holding jump
pm->ps->pm_flags &= ~PMF_JUMP_HELD;
}
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index cfe456c5..5be99588 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -242,12 +242,12 @@ typedef enum
#define SS_POISONED 0x00000020
#define SS_HOVELING 0x00000040
#define SS_BOOSTED 0x00000080
-#define SS_SLOWLOCKED 0x00000100
-#define SS_BOOSTEDWARNING 0x00000200 // booster poison is running out
+#define SS_BOOSTEDWARNING 0x00000100 // booster poison is running out
+#define SS_SLOWLOCKED 0x00000200
#define SS_CHARGING 0x00000400
-#define SS_HEALING_ACTIVE 0x00002000 // medistat for Humans, creep for Aliens
-#define SS_HEALING_2X 0x00004000 // medkit or double healing rate (for HUD)
-#define SS_HEALING_3X 0x00008000 // triple healing rate (for HUD)
+#define SS_HEALING_ACTIVE 0x00000800 // medistat for humans, creep for aliens
+#define SS_HEALING_2X 0x00001000 // medkit or double healing rate
+#define SS_HEALING_3X 0x00002000 // triple healing rate
#define SB_VALID_TOGGLEBIT 0x00004000
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 29b57c4f..e004346a 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -198,7 +198,7 @@ ClientShove
*/
static int GetClientMass( gentity_t *ent )
{
- int entMass = 75;
+ int entMass = 100;
if( ent->client->pers.teamSelection == TEAM_ALIENS )
entMass = BG_Class( ent->client->pers.classSelection )->health;
@@ -459,11 +459,12 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd )
client->ps.pm_type = PM_FREEZE;
else if( client->noclip )
client->ps.pm_type = PM_NOCLIP;
- else if( queued )
- client->ps.pm_flags |= PMF_QUEUED;
-
+ else
client->ps.pm_type = PM_SPECTATOR;
+ if( queued )
+ client->ps.pm_flags |= PMF_QUEUED;
+
client->ps.speed = client->pers.flySpeed;
client->ps.stats[ STAT_STAMINA ] = 0;
client->ps.stats[ STAT_MISC ] = 0;
@@ -760,11 +761,7 @@ void ClientTimerActions( gentity_t *ent, int msec )
// Regenerate Adv. Dragoon barbs
if( client->ps.weapon == WP_ALEVEL3_UPG )
{
- int maxAmmo;
-
- maxAmmo = BG_Weapon( WP_ALEVEL3_UPG )->maxAmmo;
-
- if( client->ps.ammo < maxAmmo )
+ if( client->ps.ammo < BG_Weapon( WP_ALEVEL3_UPG )->maxAmmo )
{
if( ent->timestamp + LEVEL3_BOUNCEBALL_REGEN < level.time )
{
@@ -1272,19 +1269,6 @@ void ClientThink_real( gentity_t *ent )
// G_Printf("serverTime >>>>>\n" );
}
- // ucmd->serverTime is a client predicted value, but it works for making a
- // replacement for client->ps.ping when in SPECTATOR_FOLLOW
- client->pers.ping = level.time - ucmd->serverTime;
-
- // account for the one frame of delay on client side
- client->pers.ping -= level.time - level.previousTime;
-
- // account for the time that's elapsed since the last ClientEndFrame()
- client->pers.ping += trap_Milliseconds() - level.frameMsec;
-
- if( client->pers.ping < 0 )
- client->pers.ping = 0;
-
msec = ucmd->serverTime - client->ps.commandTime;
// following others may result in bad times, but we still want
// to check for follow toggles
@@ -1840,24 +1824,20 @@ void SpectatorClientEndFrame( gentity_t *ent )
cl = &level.clients[ clientNum ];
if( cl->pers.connected == CON_CONNECTED )
{
- if( cl->sess.spectatorState == SPECTATOR_NOT )
- {
- // Save
- flags = ( cl->ps.eFlags & ~( EF_VOTED | EF_TEAMVOTED ) ) |
- ( ent->client->ps.eFlags & ( EF_VOTED | EF_TEAMVOTED ) );
- score = ent->client->ps.persistant[ PERS_SCORE ];
- ping = ent->client->ps.ping;
-
- // Copy
- ent->client->ps = cl->ps;
-
- // Restore
- ent->client->ps.eFlags = flags;
- ent->client->ps.persistant[ PERS_SCORE ] = score;
- ent->client->ps.ping = ping;
- }
+ // Save
+ flags = ( cl->ps.eFlags & ~( EF_VOTED | EF_TEAMVOTED ) ) |
+ ( ent->client->ps.eFlags & ( EF_VOTED | EF_TEAMVOTED ) );
+ score = ent->client->ps.persistant[ PERS_SCORE ];
+ ping = ent->client->ps.ping;
+
+ // Copy
+ ent->client->ps = cl->ps;
+
+ // Restore
+ ent->client->ps.eFlags = flags;
+ ent->client->ps.persistant[ PERS_SCORE ] = score;
+ ent->client->ps.ping = ping;
- ent->client->ps.clientNum = clientNum;
ent->client->ps.pm_flags |= PMF_FOLLOW;
ent->client->ps.pm_flags &= ~PMF_QUEUED;
}
@@ -1886,10 +1866,6 @@ void ClientEndFrame( gentity_t *ent )
pers = &ent->client->pers;
- // save a copy of certain playerState values in case of SPECTATOR_FOLLOW
- pers->score = ent->client->ps.persistant[ PERS_SCORE ];
- pers->credit = ent->client->ps.persistant[ PERS_CREDIT ];
-
//
// If the end of unit layout is displayed, don't give
// the player any normal movement attributes
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index e2bc16a8..889836cc 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -594,7 +594,7 @@ void AGeneric_Blast( gentity_t *self )
TEAM_ALIENS );
//pretty events and item cleanup
- self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed
+ self->s.eFlags |= EF_NODRAW; //don't draw the model once it's destroyed
G_AddEvent( self, EV_ALIEN_BUILDABLE_EXPLOSION, DirToByte( dir ) );
self->timestamp = level.time;
self->think = AGeneric_CreepRecede;
@@ -2367,7 +2367,7 @@ void HSpawn_Think( gentity_t *self )
// If it's part of the map, kill self.
if( ent->s.eType == ET_BUILDABLE )
{
- G_Damage( ent, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE );
+ G_Damage( ent, NULL, NULL, NULL, NULL, self->health, 0, MOD_SUICIDE );
G_SetBuildableAnim( self, BANIM_SPAWN1, qtrue );
}
else if( ent->s.number == ENTITYNUM_WORLD || ent->s.eType == ET_MOVER )
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 912e9dd9..174498ab 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -91,19 +91,15 @@ void G_AddCreditToClient( gclient_t *client, short credit, qboolean cap )
if( !client )
return;
- client->pers.credit += credit;
- capAmount = client->pers.teamSelection == TEAM_ALIENS ?
- ALIEN_MAX_FRAGS * ALIEN_CREDITS_PER_FRAG : HUMAN_MAX_CREDITS;
+ client->ps.persistant[ PERS_CREDIT ] += credit;
+ capAmount = client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ?
+ ALIEN_MAX_CREDITS : HUMAN_MAX_CREDITS;
- if( cap && client->pers.credit > capAmount )
- client->pers.credit = capAmount;
+ if( cap && client->ps.persistant[ PERS_CREDIT ] > capAmount )
+ client->ps.persistant[ PERS_CREDIT ] = capAmount;
- if( client->pers.credit < 0 )
- client->pers.credit = 0;
-
- // keep PERS_CREDIT in sync if not following
- if( client->sess.spectatorState != SPECTATOR_FOLLOW )
- client->ps.persistant[ PERS_CREDIT ] = client->pers.credit;
+ if( client->ps.persistant[ PERS_CREDIT ] < 0 )
+ client->ps.persistant[ PERS_CREDIT ] = 0;
}
@@ -1455,10 +1451,6 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
client->ps.persistant[ PERS_SPAWN_COUNT ]++;
client->ps.persistant[ PERS_SPECSTATE ] = client->sess.spectatorState;
- // restore really persistant things
- client->ps.persistant[ PERS_SCORE ] = client->pers.score;
- client->ps.persistant[ PERS_CREDIT ] = client->pers.credit;
-
client->airOutTime = level.time + 12000;
trap_GetUserinfo( index, userinfo, sizeof( userinfo ) );
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index b0f1bdd1..2bca3a27 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -252,8 +252,6 @@ void ScoreboardMessage( gentity_t *ent )
if( cl->pers.connected == CON_CONNECTING )
ping = -1;
- else if( cl->sess.spectatorState == SPECTATOR_FOLLOW )
- ping = cl->pers.ping < 999 ? cl->pers.ping : 999;
else
ping = cl->ps.ping < 999 ? cl->ps.ping : 999;
@@ -283,7 +281,7 @@ void ScoreboardMessage( gentity_t *ent )
}
Com_sprintf( entry, sizeof( entry ),
- " %d %d %d %d %d %d", level.sortedClients[ i ], cl->pers.score,
+ " %d %d %d %d %d %d", level.sortedClients[ i ], cl->ps.persistant[ PERS_SCORE ],
ping, ( level.time - cl->pers.enterTime ) / 60000, weapon, upgrade );
j = strlen( entry );
@@ -397,22 +395,18 @@ void Cmd_Give_f( gentity_t *ent )
if( give_all || Q_stricmp( name, "ammo" ) == 0 )
{
- int maxAmmo, maxClips;
gclient_t *client = ent->client;
if( client->ps.weapon != WP_ALEVEL3_UPG &&
BG_Weapon( client->ps.weapon )->infiniteAmmo )
return;
- maxAmmo = BG_Weapon( client->ps.weapon )->maxAmmo;
- maxClips = BG_Weapon( client->ps.weapon )->maxClips;
+ client->ps.ammo = BG_Weapon( client->ps.weapon )->maxAmmo;
+ client->ps.clips = BG_Weapon( client->ps.weapon )->maxClips;
if( BG_Weapon( client->ps.weapon )->usesEnergy &&
BG_InventoryContainsUpgrade( UP_BATTPACK, client->ps.stats ) )
- maxAmmo = (int)( (float)maxAmmo * BATTPACK_MODIFIER );
-
- client->ps.ammo = maxAmmo;
- client->ps.clips = maxClips;
+ client->ps.ammo = (int)( (float)client->ps.ammo * BATTPACK_MODIFIER );
}
}
@@ -1648,7 +1642,8 @@ void Cmd_SetViewpos_f( gentity_t *ent )
#define AS_OVER_RT3 ((ALIENSENSE_RANGE*0.5f)/M_ROOT3)
-static qboolean G_RoomForClassChange( gentity_t *ent, class_t class, vec3_t newOrigin )
+static qboolean G_RoomForClassChange( gentity_t *ent, class_t class,
+ vec3_t newOrigin )
{
vec3_t fromMins, fromMaxs;
vec3_t toMins, toMaxs;
@@ -2005,7 +2000,7 @@ void Cmd_Destroy_f( gentity_t *ent )
if( !g_cheats.integer )
{
ent->client->ps.stats[ STAT_MISC ] +=
- BG_Buildable( traceEnt->s.modelindex )->buildTime;
+ BG_Buildable( traceEnt->s.modelindex )->buildTime / 4;
}
}
}
@@ -2122,7 +2117,7 @@ void Cmd_Buy_f( gentity_t *ent )
{
char s[ MAX_TOKEN_CHARS ];
weapon_t weapon;
- upgrade_t upgrade, maxAmmo, maxClips;
+ upgrade_t upgrade;
qboolean energyOnly;
trap_Argv( 1, s, sizeof( s ) );
@@ -2197,15 +2192,12 @@ void Cmd_Buy_f( gentity_t *ent )
return;
ent->client->ps.stats[ STAT_WEAPON ] = weapon;
- maxAmmo = BG_Weapon( weapon )->maxAmmo;
- maxClips = BG_Weapon( weapon )->maxClips;
+ ent->client->ps.ammo = BG_Weapon( weapon )->maxAmmo;
+ ent->client->ps.clips = BG_Weapon( weapon )->maxClips;
if( BG_Weapon( weapon )->usesEnergy &&
BG_InventoryContainsUpgrade( UP_BATTPACK, ent->client->ps.stats ) )
- maxAmmo *= BATTPACK_MODIFIER;
-
- ent->client->ps.ammo = maxAmmo;
- ent->client->ps.clips = maxClips;
+ ent->client->ps.ammo *= BATTPACK_MODIFIER;
G_ForceWeaponChange( ent, weapon );
@@ -2634,8 +2626,6 @@ to free floating spectator mode
*/
void G_StopFollowing( gentity_t *ent )
{
- ent->client->sess.spectatorState =
- ent->client->ps.persistant[ PERS_SPECSTATE ] = SPECTATOR_FREE;
ent->client->ps.stats[ STAT_TEAM ] = ent->client->pers.teamSelection;
if( ent->client->pers.teamSelection == TEAM_NONE )
@@ -2747,7 +2737,7 @@ qboolean G_FollowNewClient( gentity_t *ent, int dir )
clientnum = level.maxclients - 1;
// can't follow self
- if( level.clients[ clientnum ].pers.connected != CON_CONNECTED )
+ if( &g_entities[ clientnum ] == ent )
continue;
// avoid selecting existing follow target
@@ -2889,9 +2879,6 @@ void Cmd_PTRCVerify_f( gentity_t *ent )
char s[ MAX_TOKEN_CHARS ] = { 0 };
int code;
- if( ent->client->pers.connection )
- return;
-
trap_Argv( 1, s, sizeof( s ) );
if( !s[ 0 ] )
@@ -2899,16 +2886,16 @@ void Cmd_PTRCVerify_f( gentity_t *ent )
code = atoi( s );
- connection = G_FindConnectionForCode( code );
- if( connection && connection->clientNum == -1 )
+ if( G_VerifyPTRC( code ) )
{
+ connection = G_FindConnectionForCode( code );
+
// valid code
if( connection->clientTeam != TEAM_NONE )
trap_SendServerCommand( ent->client->ps.clientNum, "ptrcconfirm" );
// restore mapping
ent->client->pers.connection = connection;
- connection->clientNum = ent->client->ps.clientNum;
}
else
{
@@ -2936,13 +2923,6 @@ void Cmd_PTRCRestore_f( gentity_t *ent )
int code;
connectionRecord_t *connection;
- if( ent->client->pers.joinedATeam )
- {
- trap_SendServerCommand( ent - g_entities,
- "print \"You cannot use a PTR code after joining a team\n\"" );
- return;
- }
-
trap_Argv( 1, s, sizeof( s ) );
if( !s[ 0 ] )
@@ -2950,15 +2930,28 @@ void Cmd_PTRCRestore_f( gentity_t *ent )
code = atoi( s );
- connection = ent->client->pers.connection;
- if( connection && connection->ptrCode == code )
+ if( G_VerifyPTRC( code ) )
{
- // set the correct team
- G_ChangeTeam( ent, connection->clientTeam );
+ if( ent->client->pers.joinedATeam )
+ {
+ trap_SendServerCommand( ent - g_entities,
+ "print \"You cannot use a PTR code after joining a team\n\"" );
+ }
+ else
+ {
+ // valid code
+ connection = G_FindConnectionForCode( code );
- // set the correct credit
- ent->client->ps.persistant[ PERS_CREDIT ] = 0;
- G_AddCreditToClient( ent->client, connection->clientCredit, qtrue );
+ if( connection )
+ {
+ // set the correct team
+ G_ChangeTeam( ent, connection->clientTeam );
+
+ // set the correct credit
+ ent->client->ps.persistant[ PERS_CREDIT ] = 0;
+ G_AddCreditToClient( ent->client, connection->clientCredit, qtrue );
+ }
+ }
}
else
{
@@ -3042,11 +3035,6 @@ Cmd_Test_f
*/
void Cmd_Test_f( gentity_t *humanPlayer )
{
- humanPlayer->client->ps.eFlags |= EF_POISONCLOUDED;
- humanPlayer->client->lastPoisonCloudedTime = level.time;
-
- trap_SendServerCommand( humanPlayer->client->ps.clientNum,
- "poisoncloud" );
}
/*
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 0e05da98..2e359ab7 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -993,26 +993,14 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
// if the attacker was on the same team
if( targ != attacker && OnSameTeam( targ, attacker ) )
{
- // if dretchpunt is enabled and this is a dretch, do dretchpunt instead of damage
- if( g_dretchPunt.integer &&
- targ->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL0 )
- {
- vec3_t dir, push;
-
- VectorSubtract( targ->r.currentOrigin, attacker->r.currentOrigin, dir );
- VectorNormalizeFast( dir );
- VectorScale( dir, ( damage * 10.0f ), push );
- push[2] = 64.0f;
- VectorAdd( targ->client->ps.velocity, push, targ->client->ps.velocity );
- return;
- }
// don't do friendly fire on movement attacks
- else if( mod == MOD_LEVEL4_TRAMPLE || mod == MOD_LEVEL3_POUNCE ||
+ if( mod == MOD_LEVEL4_TRAMPLE || mod == MOD_LEVEL3_POUNCE ||
mod == MOD_LEVEL4_CRUSH )
return;
+ // if dretchpunt is enabled and this is a dretch, do dretchpunt instead of damage
if( g_dretchPunt.integer &&
- targ->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL0 )
+ targ->client->ps.stats[ STAT_CLASS ] == PCL_ALIEN_LEVEL0 )
{
vec3_t dir, push;
@@ -1023,13 +1011,16 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
VectorAdd( targ->client->ps.velocity, push, targ->client->ps.velocity );
return;
}
- else if( !g_friendlyFire.integer )
+
+ // check if friendly fire has been disabled
+ if( !g_friendlyFire.integer )
{
if( !g_friendlyFireHumans.integer &&
targ->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
{
return;
}
+
if( !g_friendlyFireAliens.integer &&
targ->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS )
{
diff --git a/src/game/g_local.h b/src/game/g_local.h
index c7b8dcd0..2068e5a6 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -318,11 +318,6 @@ typedef struct
int nameChangeTime;
int nameChanges;
- // used to save playerState_t values while in SPECTATOR_FOLLOW mode
- int score;
- int credit;
- int ping;
-
// used to save persistant[] values while in SPECTATOR_FOLLOW mode
int savedCredit;
@@ -1073,8 +1068,10 @@ qboolean G_MapExists( char *name );
//
void G_UpdatePTRConnection( gclient_t *client );
connectionRecord_t *G_GenerateNewConnection( gclient_t *client );
+qboolean G_VerifyPTRC( int code );
void G_ResetPTRConnections( void );
connectionRecord_t *G_FindConnectionForCode( int code );
+void G_DeletePTRConnection( connectionRecord_t *connection );
//some maxs
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 44ffd098..89e47759 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -760,9 +760,9 @@ int QDECL SortRanks( const void *a, const void *b )
cb = &level.clients[ *(int *)b ];
// then sort by score
- if( ca->pers.score > cb->pers.score )
+ if( ca->ps.persistant[ PERS_SCORE ] > cb->ps.persistant[ PERS_SCORE ] )
return -1;
- else if( ca->pers.score < cb->pers.score )
+ if( ca->ps.persistant[ PERS_SCORE ] < cb->ps.persistant[ PERS_SCORE ] )
return 1;
else
return 0;
diff --git a/src/game/g_ptr.c b/src/game/g_ptr.c
index 21e2636e..869df256 100644
--- a/src/game/g_ptr.c
+++ b/src/game/g_ptr.c
@@ -63,7 +63,7 @@ void G_UpdatePTRConnection( gclient_t *client )
{
client->pers.connection->clientTeam = client->pers.teamSelection;
if( client->pers.teamSelection == TEAM_NONE )
- client->pers.connection->clientCredit = client->pers.credit;
+ client->pers.connection->clientCredit = client->pers.savedCredit;
else
client->pers.connection->clientCredit = client->ps.persistant[ PERS_CREDIT ];
}
@@ -107,6 +107,29 @@ connectionRecord_t *G_GenerateNewConnection( gclient_t *client )
/*
===============
+G_VerifyPTRC
+
+Check a PTR code for validity
+===============
+*/
+qboolean G_VerifyPTRC( int code )
+{
+ int i;
+
+ if( code == 0 )
+ return qfalse;
+
+ for( i = 0; i < MAX_CLIENTS; i++ )
+ {
+ if( connections[ i ].ptrCode == code )
+ return qtrue;
+ }
+
+ return qfalse;
+}
+
+/*
+===============
G_FindConnectionForCode
Finds a connection for a given code
@@ -130,6 +153,19 @@ connectionRecord_t *G_FindConnectionForCode( int code )
/*
===============
+G_DeletePTRConnection
+
+Finds a connection and deletes it
+===============
+*/
+void G_DeletePTRConnection( connectionRecord_t *connection )
+{
+ if( connection )
+ memset( connection, 0, sizeof( connectionRecord_t ) );
+}
+
+/*
+===============
G_ResetPTRConnections
Invalidate any existing codes
diff --git a/src/game/g_svcmds.c b/src/game/g_svcmds.c
index d74fb147..72523331 100644
--- a/src/game/g_svcmds.c
+++ b/src/game/g_svcmds.c
@@ -100,6 +100,9 @@ void Svcmd_EntityList_f( void )
case ET_LIGHTFLARE:
G_Printf( "ET_LIGHTFLARE " );
break;
+ case ET_LEV2_ZAP_CHAIN:
+ G_Printf( "ET_LEV2_ZAP_CHAIN " );
+ break;
default:
G_Printf( "%-3i ", check->s.eType );
break;
diff --git a/src/game/g_team.c b/src/game/g_team.c
index c3c490e5..856e0f20 100644
--- a/src/game/g_team.c
+++ b/src/game/g_team.c
@@ -95,7 +95,6 @@ void G_LeaveTeam( gentity_t *self )
G_RemoveFromSpawnQueue( &level.humanSpawnQueue, self->client->ps.clientNum );
else
{
- // might have been following somone so reset
if( self->client->sess.spectatorState == SPECTATOR_FOLLOW )
G_StopFollowing( self );
return;
@@ -164,8 +163,6 @@ void G_ChangeTeam( gentity_t *ent, team_t newTeam )
HUMAN_MAX_CREDITS / ALIEN_MAX_CREDITS + 0.5f );
}
- ent->client->pers.credit = ent->client->ps.persistant[ PERS_CREDIT ];
-
if( newTeam == TEAM_NONE )
{
// save values before the client enters the spectator team and their
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index b150d65f..72bd730c 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -53,7 +53,7 @@ void G_ForceWeaponChange( gentity_t *ent, weapon_t weapon )
!BG_InventoryContainsWeapon( weapon, ps->stats ) )
{
// switch to the first non blaster weapon
- ent->client->ps.persistant[ PERS_NEWWEAPON ] =
+ ps->persistant[ PERS_NEWWEAPON ] =
BG_PrimaryWeapon( ent->client->ps.stats );
}
else
@@ -931,9 +931,6 @@ qboolean CheckVenomAttack( gentity_t *ent )
if( traceEnt->health <= 0 )
return qfalse;
- if( traceEnt->health <= 0 )
- return qfalse;
-
if( !traceEnt->client && !( traceEnt->s.eType == ET_BUILDABLE ) )
return qfalse;