Renamed and moved some functions

This commit is contained in:
Walter Julius Hennecke 2012-11-16 00:58:56 +01:00
parent b6feda9b2b
commit 4c1a8d0910
13 changed files with 415 additions and 320 deletions

View File

@ -22,7 +22,7 @@ static void TryUse( gentity_t *ent )
trace_t trace;
vec3_t src, dest, vf;
clientSession_t *sess;
if(!ent || !ent->client) return;
sess = &ent->client->sess;
@ -60,10 +60,10 @@ static void TryUse( gentity_t *ent )
}
//FIXME: play sound?
target->use( target, ent, ent );
#ifdef G_LUA
#ifdef G_LUA
if(target->luaUse)
LuaHook_G_EntityUse(target->luaUse, target-g_entities, ent-g_entities, ent-g_entities);
#endif
#endif
return;
}
else if ( target && target->use && Q_stricmp("misc_ammo_station", target->classname) == 0 )
@ -80,10 +80,10 @@ static void TryUse( gentity_t *ent )
}
}
target->use( target, ent, ent );
#ifdef G_LUA
#ifdef G_LUA
if(target->luaUse)
LuaHook_G_EntityUse(target->luaUse, target-g_entities, ent-g_entities, ent-g_entities);
#endif
#endif
return;
}
else if ( (target && target->s.number == ENTITYNUM_WORLD) || (target->s.pos.trType == TR_STATIONARY && !(trace.surfaceFlags & SURF_NOIMPACT) && !target->takedamage) )
@ -233,19 +233,19 @@ static void P_WorldEffects( gentity_t *ent ) {
//
if (waterlevel &&
(ent->watertype&(CONTENTS_LAVA|CONTENTS_SLIME)) ) {
if (ent->health > 0
&& ent->pain_debounce_time < level.time ) {
if (ent->health > 0
&& ent->pain_debounce_time < level.time ) {
if (ent->watertype & CONTENTS_LAVA) {
G_Damage (ent, NULL, NULL, NULL, NULL,
30*waterlevel, 0, MOD_LAVA);
}
if (ent->watertype & CONTENTS_LAVA) {
G_Damage (ent, NULL, NULL, NULL, NULL,
30*waterlevel, 0, MOD_LAVA);
}
if (ent->watertype & CONTENTS_SLIME) {
G_Damage (ent, NULL, NULL, NULL, NULL,
10*waterlevel, 0, MOD_SLIME);
if (ent->watertype & CONTENTS_SLIME) {
G_Damage (ent, NULL, NULL, NULL, NULL,
10*waterlevel, 0, MOD_SLIME);
}
}
}
}
}
@ -344,12 +344,12 @@ void G_TouchTriggers( gentity_t *ent ) {
for ( i=0 ; i<num ; i++ ) {
hit = &g_entities[touch[i]];
#ifdef G_LUA
#ifdef G_LUA
if(hit->luaTouch)
{
LuaHook_G_EntityTouch(hit->luaTouch, hit->s.number, ent->s.number);
}
#endif
#endif
if ( !hit->touch && !ent->touch ) {
continue;
@ -363,7 +363,7 @@ void G_TouchTriggers( gentity_t *ent ) {
{
// this is ugly but adding a new ET_? type will
// most likely cause network incompatibilities
if ( hit->s.eType != ET_TELEPORT_TRIGGER && hit->touch != Touch_DoorTrigger)
if ( hit->s.eType != ET_TELEPORT_TRIGGER && hit->touch != G_Mover_TouchDoorTrigger)
{
continue;
}
@ -463,10 +463,10 @@ static qboolean ClientInactivityTimer( gclient_t *client )
client->inactivityWarning = qfalse;
}
else if ( cmd->forwardmove ||
cmd->rightmove ||
cmd->upmove ||
(cmd->buttons & BUTTON_ATTACK) ||
(cmd->buttons & BUTTON_ALT_ATTACK) )
cmd->rightmove ||
cmd->upmove ||
(cmd->buttons & BUTTON_ATTACK) ||
(cmd->buttons & BUTTON_ALT_ATTACK) )
{
client->inactivityTime = level.time + g_inactivity.integer * 1000;
client->inactivityWarning = qfalse;
@ -548,7 +548,7 @@ static void ClientTimerActions( gentity_t *ent, int msec ) {
if( rpg_timedmessagetime.value ){
//Make sure its not less then one //TiM: Well... we can have under 1, just not toooo far under 1
if(rpg_timedmessagetime.value < 0.2) { //1
messageTime = 0.2;
}else{
@ -557,7 +557,7 @@ static void ClientTimerActions( gentity_t *ent, int msec ) {
if (level.time > (level.message + (messageTime * 60000)) ) {
level.message = level.time;
//TiM - There. So with this working in conjunction with that reset
//code above, this should be more efficient. :)
message = TimedMessage(); //Since we're working with a gloabl scope variable, there's no need for this thing to have parameters:)
@ -618,27 +618,6 @@ static void ClientIntermissionThink( gclient_t *client ) {
}
}
/*
====================
Cmd_Ready_f
====================
*/
/**
* This function is called from the ui_sp_postgame.c as a result of clicking on the
* "next" button in non GT_TOURNAMENT games. This replaces the old system of waiting
* for the user to click an ATTACK or USE button to signal ready
* (see ClientIntermissionThink())
*
* when all clients have signaled ready, the game continues to the next match.
*/
void Cmd_Ready_f (gentity_t *ent)
{
gclient_t *client;
client = ent->client;
client->readyToExit = qtrue;
}
typedef struct detHit_s
@ -954,7 +933,7 @@ static qhandle_t shieldDeactivateSound=0;
/**
* Remove a forcefield
*/
void ShieldRemove(gentity_t *self)
void G_Active_ShieldRemove(gentity_t *self)
{
self->think = G_FreeEntity;
self->nextthink = level.time + 300;
@ -989,7 +968,7 @@ void ShieldDie(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int d
// Play damaging sound...
G_AddEvent(self, EV_GENERAL_SOUND, shieldDamageSound);
ShieldRemove(self);
G_Active_ShieldRemove(self);
}
@ -1019,7 +998,7 @@ void ShieldGoSolid(gentity_t *self)
if (self->health <= 0)
{
ShieldRemove(self);
G_Active_ShieldRemove(self);
return;
}
@ -1037,7 +1016,7 @@ void ShieldGoSolid(gentity_t *self)
self->nextthink = level.time + 1000;
self->think = ShieldThink;
self->takedamage = qtrue;//RPG-X: - RedTechie use to be qtrue //TiM - made true again. should be okay so long as the health isn't decremented
trap_LinkEntity(self);
}
@ -1128,19 +1107,19 @@ void ShieldTouch(gentity_t *self, gentity_t *other, trace_t *trace)
rpg_forcefielddamage.integer = 999;
}
other->health -= rpg_forcefielddamage.integer;
//RPG-X: RedTechie - Fixed free ent if medic revive on
if(rpg_medicsrevive.integer == 1){
if(other->health <= 1){
other->client->ps.stats[STAT_WEAPONS] = ( 1 << WP_0 );
other->client->ps.stats[STAT_HOLDABLE_ITEM] = HI_NONE;
other->client->ps.stats[STAT_HEALTH] = other->health = 1;
player_die (other, other, other, 1, MOD_FORCEFIELD);
G_Client_Die (other, other, other, 1, MOD_FORCEFIELD);
}
}else{
if(other->health <= 1){
other->client->ps.stats[STAT_HEALTH] = other->health = 0;
player_die (other, other, other, 100000, MOD_FORCEFIELD);
G_Client_Die (other, other, other, 100000, MOD_FORCEFIELD);
}
}
}
@ -1225,10 +1204,10 @@ void CreateShield(gentity_t *ent)
}
ent->clipmask = MASK_SHOT;
// xaxis - 1 bit
// height - 0-254 8 bits //10
// posWidth - 0-255 8 bits //10
// negWidth - 0 - 255 8 bits
// xaxis - 1 bit
// height - 0-254 8 bits //10
// posWidth - 0-255 8 bits //10
// negWidth - 0 - 255 8 bits
paramData = (xaxis << 30) | ((height&1023) << 20) | ((posWidth&1023) << 10) | (negWidth&1023); //24 16 8
ent->s.time2 = paramData;
@ -1241,14 +1220,14 @@ void CreateShield(gentity_t *ent)
{
ent->team = "2";
}
ent->health = ceil(SHIELD_HEALTH*g_dmgmult.value);
ent->s.time = ent->health;//???
ent->pain = ShieldPain;
ent->die = ShieldDie;
ent->touch = ShieldTouch;
ent->r.svFlags |= SVF_SHIELD_BBOX;
// see if we're valid
@ -1409,18 +1388,18 @@ void flushDecoys( gentity_t *ent ) {
while ( (decoy = G_Find( decoy, FOFS(classname), "decoy" )) != NULL )
{
if ( decoy->parent != ent )
//if ( decoy->s.clientNum != ent->client->ps.clientNum )
//if ( decoy->s.clientNum != ent->client->ps.clientNum )
{
continue;
}
foundDecoys[decoyCount++] = decoy->s.clientNum;
}
//now remove first ones we find until there are only 9 left
decoy = NULL;
orgCount = decoyCount;
lowestTimeStamp = level.time;
//RPG-X: TiM - Let's limit it to say... 64 decoys per player
while ( decoyCount > 64 ) //9
{
@ -1432,7 +1411,7 @@ void flushDecoys( gentity_t *ent ) {
continue;
}
decoy = &g_entities[foundDecoys[i]];
if ( decoy && decoy->timestamp < lowestTimeStamp )
{
removeMe = i;
@ -1460,7 +1439,7 @@ void flushDecoys( gentity_t *ent ) {
}
}
}
/**
* entities spawn non solid and through this function,
* they'll become solid once nothing's detected in their boundaries. :)
@ -1534,7 +1513,7 @@ qboolean PlaceDecoy(gentity_t *ent)
gentity_t *oldDecoy;
for ( i = 0; i<level.num_entities; i++ ) {
oldDecoy = &g_entities[i];
oldDecoy = &g_entities[i];
if ( !Q_stricmp( oldDecoy->classname, "decoy" ) && oldDecoy->s.eventParm == level.decoyIndex ) {
G_FreeEntity( oldDecoy );
@ -1609,7 +1588,7 @@ qboolean PlaceDecoy(gentity_t *ent)
char height[9];
char weight[9];
char offset[6];
//TiM - ensure that we encapsulate this data better or else it sometimes
//becomes null
Q_strncpyz( model, Info_ValueForKey( userinfo, "model" ), sizeof( model ) );
@ -1618,11 +1597,11 @@ qboolean PlaceDecoy(gentity_t *ent)
Q_strncpyz( offset, Info_ValueForKey( userinfo, "modelOffset" ), sizeof( offset ) );
Com_sprintf( buffer, sizeof( buffer ), "model\\%s\\height\\%s\\weight\\%s\\moOf\\%s\\c\\%i",
model,
height,
weight,
offset,
ent->client->sess.sessionClass );
model,
height,
weight,
offset,
ent->client->sess.sessionClass );
trap_SetConfigstring( CS_DECOYS + level.decoyIndex, buffer );
}
@ -1727,7 +1706,7 @@ static void ClientEvents( gentity_t *ent, int oldEventSequence ) {
//TiM: Since we purge the vectors each cycle. I'll save us some memory by using the vectors themselves as a check.
if ( TransDat[ps->clientNum].beamTime == 0 &&
VectorCompare( vec3_origin, TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].origin ) &&
VectorCompare( vec3_origin, TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].angles ) )
VectorCompare( vec3_origin, TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].angles ) )
{
VectorCopy( ps->origin, TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].origin );
VectorCopy( ps->viewangles, TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].angles );
@ -1739,7 +1718,7 @@ static void ClientEvents( gentity_t *ent, int oldEventSequence ) {
if ( TransDat[ps->clientNum].beamTime == 0 && level.time > ps->powerups[PW_QUAD] ) {
G_InitTransport( ps->clientNum, TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].origin,
TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].angles );
TransDat[ps->clientNum].storedCoord[TPT_PORTABLE].angles );
memset( &TransDat[ps->clientNum].storedCoord[TPT_PORTABLE], 0, sizeof( TransDat[ps->clientNum].storedCoord[TPT_PORTABLE]) );
}
@ -1748,7 +1727,7 @@ static void ClientEvents( gentity_t *ent, int oldEventSequence ) {
}
ps->stats[STAT_USEABLE_PLACED] = 0;
if (g_classData[client->sess.sessionClass].isMarine)
{
client->teleportTime = level.time + ( 3 * 1000 ); // 15 * 1000
@ -1853,25 +1832,25 @@ void ThrowWeapon( gentity_t *ent, char *txt )
ucmd = &ent->client->pers.cmd;
ps = &client->ps;
if ( rpg_allowWeaponDrop.integer == 0) {
return;
}
if ( rpg_allowWeaponDrop.integer == 0) {
return;
}
if ( numTotalDropped >= MAX_DROPPED ) {
WARNING(("RPG-X Warning: maximum of dropped items of %i reached.\n", MAX_DROPPED));
return;
}
if ( ps->weapon == WP_1 || ( ucmd->buttons & BUTTON_ATTACK )) {
if ( ps->weapon == WP_1 || ( ucmd->buttons & BUTTON_ATTACK )) {
return;
}
}
numTotalDropped++;
item = BG_FindItemForWeapon( ps->weapon );
// admins don't lose weapon when thrown
if ( IsAdmin( ent ) == qfalse ) {
// admins don't lose weapon when thrown
if ( IsAdmin( ent ) == qfalse ) {
ps->ammo[ ps->weapon ] -= 1;
if (ps->ammo[ ps->weapon ] <= 0) {
ps->stats[STAT_WEAPONS] &= ~( 1 << ps->weapon );
@ -1883,10 +1862,10 @@ void ThrowWeapon( gentity_t *ent, char *txt )
}
}
}
}
}
drop = DropWeapon( ent, item, 0, FL_DROPPED_ITEM | FL_THROWN_ITEM, txt );
drop->parent = ent;
drop->parent = ent;
drop->count = 1;
}
@ -1925,7 +1904,7 @@ static void SendPendingPredictableEvents( playerState_t *ps ) {
static void ClientCamThink(gentity_t *client) {
if(!client->client->cam) return;
G_SetOrigin(client, client->client->cam->s.origin);
SetClientViewAngle(client, client->client->cam->s.angles);
G_Client_SetViewAngle(client, client->client->cam->s.angles);
trap_LinkEntity(client);
}
@ -1935,17 +1914,17 @@ ClientThink
==============
*/
/**
* This will be called once for each client frame, which will
* usually be a couple times for each server frame on fast clients.
* This will be called once for each client frame, which will
* usually be a couple times for each server frame on fast clients.
*
* If "g_synchronousClients 1" is set, this will be called exactly
* once for each server frame, which makes for smooth demo recording.
* If "g_synchronousClients 1" is set, this will be called exactly
* once for each server frame, which makes for smooth demo recording.
*/
static void ClientThink_real( gentity_t *ent ) {
gclient_t *client;
pmove_t pm;
int oldEventSequence;
int msec;
pmove_t pm;
int oldEventSequence;
int msec;
usercmd_t *ucmd;
playerState_t *ps;
@ -2013,7 +1992,7 @@ static void ClientThink_real( gentity_t *ent ) {
ent->r.contents = CONTENTS_CORPSE;
}
}
//RPG-X: Checked to see if medics revive is on if so do as following
if(rpg_medicsrevive.integer == 1){
if ( client->noclip ) {
@ -2032,7 +2011,7 @@ static void ClientThink_real( gentity_t *ent ) {
ps->pm_type = PM_NORMAL;
}
}
//RPG-X: J2J & Phenix - For the gravity ent
if(client->SpecialGrav != qtrue)
{
@ -2053,15 +2032,15 @@ static void ClientThink_real( gentity_t *ent ) {
else if ( ps->stats[STAT_HEALTH] <= 20 ) {
ps->speed *= 0.55;
}
if (( ps->powerups[PW_EVOSUIT] ) && ( ps->gravity == 0 ))
{//Evosuit time.. RPG-X | Phenix | 8/8/2004
ps->speed *= 1.3;
}
//RPG-X: Redtechie - n00bie stay.....good boy!
if ( g_classData[client->sess.sessionClass].isn00b ){
ps->speed = 0;
ps->speed = 0;
}
//TiM : SP Style Transporter. :)
@ -2072,9 +2051,9 @@ static void ClientThink_real( gentity_t *ent ) {
//so bullets and other players will pass thru the transportee. :)
if ( (level.time > TransDat[ps->clientNum].beamTime - 6000) &&
( level.time < TransDat[ps->clientNum].beamTime - 2000 ) ) {
if ( ps->stats[STAT_HEALTH] > 1 ) {
ent->r.contents = CONTENTS_NONE;
}
if ( ps->stats[STAT_HEALTH] > 1 ) {
ent->r.contents = CONTENTS_NONE;
}
}
else {
if ( ps->stats[STAT_HEALTH] > 1 ) {
@ -2083,13 +2062,13 @@ static void ClientThink_real( gentity_t *ent ) {
}
//If we're half-way thru the cycle, teleport the player now
if ( level.time > TransDat[ps->clientNum].beamTime - 4000 &&
!TransDat[ps->clientNum].beamed ) {
TeleportPlayer( ent, TransDat[ps->clientNum].currentCoord.origin,
TransDat[ps->clientNum].currentCoord.angles,
TP_TRI_TP );
if ( level.time > TransDat[ps->clientNum].beamTime - 4000 &&
!TransDat[ps->clientNum].beamed ) {
TeleportPlayer( ent, TransDat[ps->clientNum].currentCoord.origin,
TransDat[ps->clientNum].currentCoord.angles,
TP_TRI_TP );
TransDat[ps->clientNum].beamed = qtrue;
TransDat[ps->clientNum].beamed = qtrue;
}
}
else {
@ -2100,8 +2079,8 @@ static void ClientThink_real( gentity_t *ent ) {
ps->powerups[PW_QUAD] = 0;
TransDat[ps->clientNum].beamed = qfalse;
memset( &TransDat[ps->clientNum].currentCoord, 0,
sizeof( TransDat[ps->clientNum].currentCoord.origin ) );
memset( &TransDat[ps->clientNum].currentCoord, 0,
sizeof( TransDat[ps->clientNum].currentCoord.origin ) );
if(g_entities[ps->clientNum].flags & FL_CLAMPED) {
//reset everything if player was beamed by trigger_transporter
@ -2111,13 +2090,13 @@ static void ClientThink_real( gentity_t *ent ) {
}
//TiM : Freeze their movement if they're halfway through a transport cycle
if ( level.time < TransDat[ps->clientNum].beamTime &&
if ( level.time < TransDat[ps->clientNum].beamTime &&
level.time > TransDat[ps->clientNum].beamTime - 4000 )
{
vec3_t endPoint;
trace_t tr;
VectorSet( endPoint, ps->origin[0], ps->origin[1], ps->origin[2] - 48 );
//Do a trace down. If we're near ground, just re-enable gravity. Else we we get weird animations O_o
//Do a trace down. If we're near ground, just re-enable gravity. Else we we get weird animations O_o
trap_Trace( &tr, ps->origin, NULL, NULL, endPoint, ps->clientNum, CONTENTS_SOLID );
if ( tr.fraction == 1.0 ) {
@ -2126,7 +2105,7 @@ static void ClientThink_real( gentity_t *ent ) {
}
ps->speed = 0;
ps->velocity[0] = ps->velocity[1] = 0.0;
}
@ -2155,7 +2134,7 @@ static void ClientThink_real( gentity_t *ent ) {
pm.admin = (qboolean)(g_classData[client->sess.sessionClass].isAdmin || client->LoggedAsAdmin);
//pm.admin = g_classData[client->sess.sessionClass].isAdmin;
pm.medic = (qboolean)g_classData[client->sess.sessionClass].isMedical;
pm.borg = (qboolean)g_classData[client->sess.sessionClass].isBorg;
pm.borg = (qboolean)g_classData[client->sess.sessionClass].isBorg;
// perform a pmove
Pmove (&pm);
@ -2181,7 +2160,7 @@ static void ClientThink_real( gentity_t *ent ) {
ClientEvents( ent, oldEventSequence );
if ( pm.useEvent )
{ //TODO: Use
{ //TODO: Use
TryUse( ent );
}
@ -2214,7 +2193,7 @@ static void ClientThink_real( gentity_t *ent ) {
if ( level.time > client->respawnTime ) {
// pressing attack or use is the normal respawn method
if ( ucmd->buttons & ( BUTTON_ATTACK | BUTTON_USE_HOLDABLE ) ) {
respawn( ent );
G_Client_Respawn( ent );
return;
}
}
@ -2309,7 +2288,7 @@ static void SpectatorClientEndFrame( gentity_t *ent ) {
// drop them to free spectators unless they are dedicated camera followers
if ( sess->spectatorClient >= 0 ) {
sess->spectatorState = SPECTATOR_FREE;
ClientBegin( ent->client - level.clients, qfalse, qfalse, qfalse );
G_Client_Begin( ent->client - level.clients, qfalse, qfalse, qfalse );
}
}
}

View File

@ -117,7 +117,7 @@ void UpdateTournamentInfo( void ) {
}
playerClientNum = i;
CalculateRanks( qfalse );
G_Client_CalculateRanks( qfalse );
// put info for the top three players into the msg
Com_sprintf(msg, AWARDS_MSG_LENGTH, "awards %d", level.numNonSpectatorClients);
for( j = 0; j < level.numNonSpectatorClients; j++ )

View File

@ -470,7 +470,7 @@ void G_CheckBotSpawn( void ) {
if ( botSpawnQueue[n].spawnTime > level.time ) {
continue;
}
ClientBegin( botSpawnQueue[n].clientNum, qfalse, qtrue, qfalse );
G_Client_Begin( botSpawnQueue[n].clientNum, qfalse, qtrue, qfalse );
botSpawnQueue[n].spawnTime = 0;
if( g_gametype.integer == GT_SINGLE_PLAYER ) {
@ -498,7 +498,7 @@ static void AddBotToSpawnQueue( int clientNum, int delay ) {
}
G_Printf( S_COLOR_YELLOW "Unable to delay spawn\n" );
ClientBegin( clientNum, qfalse, qtrue, qfalse );
G_Client_Begin( clientNum, qfalse, qtrue, qfalse );
}
@ -632,7 +632,7 @@ static void G_AddBot( const char *name, float skill, const char *team, const cha
// initialize the bot settings
if( !team || !*team ) {
if( g_gametype.integer >= GT_TEAM ) {
if( PickTeam(clientNum) == TEAM_RED) {
if( G_Client_PickTeam(clientNum) == TEAM_RED) {
team = "red";
}
else {
@ -666,14 +666,14 @@ static void G_AddBot( const char *name, float skill, const char *team, const cha
}
else
{
bot->client->sess.sessionTeam = PickTeam( -1 );
bot->client->sess.sessionTeam = G_Client_PickTeam( -1 );
}
}
preTeam = bot->client->sess.sessionTeam;
// have it connect to the game as a normal client
if ( ClientConnect( clientNum, qtrue, qtrue ) ) {
if ( G_Client_Connect( clientNum, qtrue, qtrue ) ) {
return;
}
@ -702,11 +702,11 @@ static void G_AddBot( const char *name, float skill, const char *team, const cha
bot->client->ps.persistant[ PERS_TEAM ] = bot->client->sess.sessionTeam;
G_ReadSessionData( bot->client );
ClientUserinfoChanged( clientNum );
G_Client_UserinfoChanged( clientNum );
}
if( delay == 0 ) {
ClientBegin( clientNum, qfalse, qfalse, qfalse );
G_Client_Begin( clientNum, qfalse, qfalse, qfalse );
return;
}

View File

@ -32,7 +32,7 @@ void Cinematic_ActivateCameraMode(gentity_t *ent, gentity_t *target) {
client->cam = target;
VectorCopy(client->ps.viewangles, client->origViewAngles);
VectorCopy(ent->r.currentOrigin, client->origOrigin);
SetClientViewAngle(ent, target->s.angles);
G_Client_SetViewAngle(ent, target->s.angles);
G_SetOrigin(ent, target->r.currentOrigin);
VectorCopy(target->r.currentOrigin, ent->client->ps.origin);
trap_LinkEntity(ent);
@ -46,7 +46,7 @@ void Cinematic_DeactivateCameraMode(gentity_t *ent) {
ent->flags ^= FL_CCAM;
G_SetOrigin(ent, client->origOrigin);
SetClientViewAngle(ent, client->origViewAngles);
G_Client_SetViewAngle(ent, client->origViewAngles);
trap_LinkEntity(ent);
}

View File

@ -18,7 +18,7 @@ extern pclass_t ValueNameForClass ( /*gentity_t *ent,*/ char* s );
extern qboolean levelExiting;
// g_client.c -- client functions that don't happen every frame
void G_StoreClientInitialStatus( gentity_t *ent );
void G_Client_StoreClientInitialStatus( gentity_t *ent );
//! players mins
static vec3_t playerMins = {-12, -12, -24}; //RPG-X : TiM - {-15, -15, -24}
@ -127,21 +127,21 @@ void SP_info_player_intermission( gentity_t *ent ) {
/*
=======================================================================
SelectSpawnPoint
G_Client_SelectSpawnPoint
=======================================================================
*/
/*
================
SpotWouldTelefrag
G_Client_SpotWouldTelefrag
================
*/
/**
* Check if beaming to a point will result in a teleporter frag.
*/
qboolean SpotWouldTelefrag( gentity_t *spot ) {
qboolean G_Client_SpotWouldTelefrag( gentity_t *spot ) {
int i, num;
int touch[MAX_GENTITIES];
gentity_t *hit;
@ -222,7 +222,7 @@ static gentity_t *SelectRandomDeathmatchSpawnPoint( void ) {
spot = NULL;
while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL) {
if ( SpotWouldTelefrag( spot ) ) {
if ( G_Client_SpotWouldTelefrag( spot ) ) {
continue;
}
spots[ count ] = spot;
@ -240,7 +240,7 @@ static gentity_t *SelectRandomDeathmatchSpawnPoint( void ) {
/*
===========
SelectSpawnPoint
G_Client_SelectSpawnPoint
Chooses a player start, deathmatch start, etc
============
@ -248,7 +248,7 @@ 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 *G_Client_SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles ) {
gentity_t *spot;
gentity_t *nearestSpot;
@ -299,8 +299,8 @@ static gentity_t *SelectInitialSpawnPoint( vec3_t origin, vec3_t angles ) {
}
}
if ( !spot || SpotWouldTelefrag( spot ) ) {
return SelectSpawnPoint( vec3_origin, origin, angles );
if ( !spot || G_Client_SpotWouldTelefrag( spot ) ) {
return G_Client_SelectSpawnPoint( vec3_origin, origin, angles );
}
VectorCopy (spot->s.origin, origin);
@ -338,10 +338,10 @@ static int bodyFadeSound=0;
/*
===============
InitBodyQue
G_Client_InitBodyQue
===============
*/
void InitBodyQue (void) {
void G_Client_InitBodyQue (void) {
int i;
gentity_t *ent;
@ -493,11 +493,11 @@ static void CopyToBodyQue( gentity_t *ent ) {
/*
==================
SetClientViewAngle
G_Client_SetViewAngle
==================
*/
void SetClientViewAngle( gentity_t *ent, vec3_t angle ) {
void G_Client_SetViewAngle( gentity_t *ent, vec3_t angle ) {
int i;
// set the delta angle
@ -513,18 +513,18 @@ void SetClientViewAngle( gentity_t *ent, vec3_t angle ) {
/*
================
respawn
G_Client_Respawn
================
*/
extern char *ClassNameForValue( pclass_t pClass );
void respawn( gentity_t *ent ) {
void G_Client_Respawn( gentity_t *ent ) {
qboolean borg = qfalse;
gentity_t *tent;
playerState_t *ps;
CopyToBodyQue (ent);
ClientSpawn(ent, 0, qfalse);//RPG-X: RedTechie - Modifyed
G_Client_Spawn(ent, 0, qfalse);//RPG-X: RedTechie - Modifyed
ps = &ent->client->ps;
@ -542,7 +542,7 @@ void respawn( gentity_t *ent ) {
/*
================
TeamCount
G_Client_TeamCount
Returns number of players on a team
================
@ -550,7 +550,7 @@ Returns number of players on a team
/**
* Returns number of players on a team
*/
team_t TeamCount( int ignoreClientNum, int team ) {
team_t G_Client_TeamCount( int ignoreClientNum, int team ) {
int i;
int count = 0;
@ -572,15 +572,15 @@ team_t TeamCount( int ignoreClientNum, int team ) {
/*
================
PickTeam
G_Client_PickTeam
================
*/
team_t PickTeam( int ignoreClientNum ) {
team_t G_Client_PickTeam( int ignoreClientNum ) {
int counts[TEAM_NUM_TEAMS];
counts[TEAM_BLUE] = TeamCount( ignoreClientNum, TEAM_BLUE );
counts[TEAM_RED] = TeamCount( ignoreClientNum, TEAM_RED );
counts[TEAM_BLUE] = G_Client_TeamCount( ignoreClientNum, TEAM_BLUE );
counts[TEAM_RED] = G_Client_TeamCount( ignoreClientNum, TEAM_RED );
if ( counts[TEAM_BLUE] > counts[TEAM_RED] ) {
return TEAM_RED;
@ -965,17 +965,17 @@ void SetCSTeam( team_t team, char *teamname )
}
/*
===========
ClientUserInfoChanged
G_Client_UserinfoChanged
============
*/
/**
* Called from ClientConnect when the player first connects and
* Called from G_Client_Connect when the player first connects and
* directly by the server system when the player updates a userinfo variable.
*
* The game can override any of the settings and call trap_SetUserinfo
* if desired.
*/
void ClientUserinfoChanged( int clientNum ) {
void G_Client_UserinfoChanged( int clientNum ) {
gentity_t *ent;
int i;
char *s;
@ -1280,7 +1280,7 @@ void ClientUserinfoChanged( int clientNum ) {
/*
===========
ClientConnect
G_Client_Connect
============
*/
/**
@ -1293,13 +1293,13 @@ ClientConnect
* a string with the reason for denial.
*
* Otherwise, the client will be sent the current gamestate
* and will eventually get to ClientBegin.
* and will eventually get to G_Client_Begin.
*
* firstTime will be qtrue the very first time a client connects
* to the server machine, but qfalse on map changes and tournement
* restarts.
*/
char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
char *G_Client_Connect( int clientNum, qboolean firstTime, qboolean isBot ) {
char *value;
gclient_t *client;
char userinfo[MAX_INFO_STRING];
@ -1444,7 +1444,7 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
//========================================================
}
ClientUserinfoChanged( clientNum );
G_Client_UserinfoChanged( clientNum );
//RPG-X: Save the ip for later - has to be down here, since it gets flushed in the above function
Q_strncpyz( ent->client->pers.ip, ip, sizeof( ent->client->pers.ip ) );
@ -1491,7 +1491,7 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
}
// count current clients and rank for scoreboard
//CalculateRanks( qfalse );
//G_Client_CalculateRanks( qfalse );
//RPG-X: J2J - Reset Variables
DragDat[clientNum].AdminId = -1;
@ -1602,7 +1602,7 @@ static void G_SendTransData(int clientNum) {
/*
===========
ClientBegin
G_Client_Begin
============
*/
/**
@ -1610,7 +1610,7 @@ ClientBegin
* to be placed into the level. This will happen every level load,
* and on transition between teams, but doesn't happen on respawns
*/
void ClientBegin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qboolean first ) {
void G_Client_Begin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qboolean first ) {
gentity_t *ent;
gclient_t *client;
gentity_t *tent;
@ -1661,7 +1661,7 @@ void ClientBegin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qbool
SetScore( ent, score );
// locate ent at a spawn point
ClientSpawn( ent, 0, qfalse );//RPG-X: RedTechie - Modifyed
G_Client_Spawn( ent, 0, qfalse );//RPG-X: RedTechie - Modifyed
if ( client->sess.sessionTeam != TEAM_SPECTATOR /*&& g_holoIntro.integer==0 */ )
{ // Don't use transporter FX for spectators or those watching the holodoors.
@ -1674,7 +1674,7 @@ void ClientBegin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qbool
G_LogPrintf( "ClientBegin: %i (%s)\n", clientNum, g_entities[clientNum].client->pers.ip );
// count current clients and rank for scoreboard
CalculateRanks( qfalse );
G_Client_CalculateRanks( qfalse );
//TiM - This appears to be a flaw in Raven's design
//When a client connects, or if they enter admin or medics class
@ -1822,7 +1822,7 @@ void ClientBegin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qbool
}
// WEAPONS - PHENIX1
void ClientWeaponsForClass ( gclient_t *client, pclass_t pclass )
void G_Client_WeaponsForClass ( gclient_t *client, pclass_t pclass )
{
int i;
int Bits;
@ -1845,7 +1845,7 @@ void ClientWeaponsForClass ( gclient_t *client, pclass_t pclass )
}
}
void ClientHoldablesForClass ( gclient_t *client, pclass_t pclass )
void G_Client_HoldablesForClass ( gclient_t *client, pclass_t pclass )
{
if ( g_classData[pclass].isMarine )
client->ps.stats[STAT_HOLDABLE_ITEM] = BG_FindItemForHoldable( HI_TRANSPORTER ) - bg_itemlist;
@ -1854,7 +1854,7 @@ void ClientHoldablesForClass ( gclient_t *client, pclass_t pclass )
client->ps.stats[STAT_HOLDABLE_ITEM] = BG_FindItemForHoldable( HI_SHIELD ) - bg_itemlist;
}
void G_StoreClientInitialStatus( gentity_t *ent )
void G_Client_StoreClientInitialStatus( gentity_t *ent )
{
char userinfo[MAX_INFO_STRING];
@ -1915,17 +1915,17 @@ void G_RestoreClientInitialStatus( gentity_t *ent )
/*
===========
ClientSpawn
G_Client_Spawn
Called every time a client is placed fresh in the world:
after the first ClientBegin, and after each respawn
after the first G_Client_Begin, and after each respawn
Initializes all non-persistant parts of playerState
------------------------------------
Modifyed By: RedTechie
And also by Marcin - 30/12/2008
============
*/
void ClientSpawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
void G_Client_Spawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
int index=0;
vec3_t spawn_origin, spawn_angles;
gclient_t *client=NULL;
@ -1959,7 +1959,7 @@ void ClientSpawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
spawnPoint = SelectInitialSpawnPoint( spawn_origin, spawn_angles );
} else {
// don't spawn near existing origin if possible
spawnPoint = SelectSpawnPoint (
spawnPoint = G_Client_SelectSpawnPoint (
client->ps.origin,
spawn_origin, spawn_angles);
}
@ -2039,7 +2039,7 @@ void ClientSpawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
ent->r.contents = CONTENTS_BODY;
ent->clipmask = MASK_PLAYERSOLID;
ent->die = player_die;
ent->die = G_Client_Die;
ent->waterlevel = 0;
ent->watertype = 0;
ent->flags = 0;
@ -2058,7 +2058,7 @@ void ClientSpawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
if ( oClass != client->sess.sessionClass )
{//need to send the class change
ClientUserinfoChanged( client->ps.clientNum );
G_Client_UserinfoChanged( client->ps.clientNum );
}
client->ps.persistant[PERS_CLASS] = client->sess.sessionClass;
@ -2070,11 +2070,11 @@ void ClientSpawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
}
if ( !fromDeath || !rpg_dropOnDeath.integer || !rpg_allowWeaponDrop.integer ) {
ClientWeaponsForClass( client, pClass );
G_Client_WeaponsForClass( client, pClass );
} else { // Marcin: just a hand
ClientWeaponsForClass( client, 0 );
G_Client_WeaponsForClass( client, 0 );
}
ClientHoldablesForClass( client, pClass );
G_Client_HoldablesForClass( client, pClass );
if(rpgx_spawn != 1){
G_SetOrigin( ent, spawn_origin );
@ -2088,7 +2088,7 @@ void ClientSpawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
trap_GetUsercmd( client - level.clients, &ent->client->pers.cmd );
if(rpgx_spawn != 1){
SetClientViewAngle( ent, spawn_angles );
G_Client_SetViewAngle( ent, spawn_angles );
}
if(rpgx_spawn != 1){
@ -2251,7 +2251,7 @@ void ClientSpawn(gentity_t *ent, int rpgx_spawn, qboolean fromDeath ) {
//store intial client values
//FIXME: when purposely change teams, this gets confused?
G_StoreClientInitialStatus( ent );
G_Client_StoreClientInitialStatus( ent );
//RPG-X: Marcin: stuff was here previously - 22/12/2008
}
@ -2291,7 +2291,7 @@ gentity_t *SpawnBeamOutPlayer( gentity_t *ent ) {
/*
===========
ClientDisconnect
G_Client_Disconnect
Called when a player drops from the server.
Will not be called between levels.
@ -2301,7 +2301,7 @@ call trap_DropClient(), which will call this and do
server system housekeeping.
============
*/
void ClientDisconnect( int clientNum ) {
void G_Client_Disconnect( int clientNum ) {
gentity_t *ent;
gentity_t *tent;
int i;
@ -2389,7 +2389,7 @@ void ClientDisconnect( int clientNum ) {
if ( g_gametype.integer == GT_TOURNAMENT && !level.intermissiontime
&& !level.warmupTime && level.sortedClients[1] == clientNum ) {
level.clients[ level.sortedClients[0] ].sess.wins++;
ClientUserinfoChanged( level.sortedClients[0] );
G_Client_UserinfoChanged( level.sortedClients[0] );
}
if ( g_gametype.integer == GT_TOURNAMENT && ent->client->sess.sessionTeam == TEAM_FREE && level.intermissiontime )
@ -2413,7 +2413,7 @@ void ClientDisconnect( int clientNum ) {
trap_SetConfigstring( CS_PLAYERS + clientNum, "");
CalculateRanks( qfalse );
G_Client_CalculateRanks( qfalse );
if ( ent->r.svFlags & SVF_BOT ) {
BotAIShutdownClient( clientNum );
@ -2706,3 +2706,4 @@ void G_Client_LocationsMessage( gentity_t *ent ) {

View File

@ -539,7 +539,7 @@ static void Cmd_LevelShot_f( gentity_t *ent ) {
level.intermissiontime = -1;
// Special 'level shot' setting -- Terrible ABUSE!!! HORRIBLE NASTY HOBBITTESSSES
BeginIntermission();
G_Client_BeginIntermission();
trap_SendServerCommand( ent-g_entities, "clientLevelShot" );
}
@ -608,10 +608,10 @@ static void Cmd_Kill_f( gentity_t *ent )
ps->stats[STAT_WEAPONS] = ( 1 << WP_0 );
ps->stats[STAT_HOLDABLE_ITEM] = HI_NONE;
ps->stats[STAT_HEALTH] = ent->health = 1;
player_die (ent, ent, ent, 1, meansOfDeath ); //MOD_SUICIDE
G_Client_Die (ent, ent, ent, 1, meansOfDeath ); //MOD_SUICIDE
}else{
ps->stats[STAT_HEALTH] = ent->health = 0;
player_die (ent, ent, ent, 100000, meansOfDeath ); //MOD_SUICIDE
G_Client_Die (ent, ent, ent, 100000, meansOfDeath ); //MOD_SUICIDE
}
if ( rpg_kicksuiciders.integer > 0 )
@ -733,7 +733,7 @@ qboolean SetTeam( gentity_t *ent, char *s ) {
// pick the team with the least number of players
if ( isBot )
{
team = PickTeam( clientNum );
team = G_Client_PickTeam( clientNum );
}
else
{
@ -746,8 +746,8 @@ qboolean SetTeam( gentity_t *ent, char *s ) {
{
int counts[TEAM_NUM_TEAMS];
counts[TEAM_BLUE] = TeamCount( clNum, TEAM_BLUE );
counts[TEAM_RED] = TeamCount( clNum, TEAM_RED );
counts[TEAM_BLUE] = G_Client_TeamCount( clNum, TEAM_BLUE );
counts[TEAM_RED] = G_Client_TeamCount( clNum, TEAM_RED );
// We allow a spread of two
if ( team == TEAM_RED && counts[TEAM_RED] - counts[TEAM_BLUE] > 1 )
@ -800,7 +800,7 @@ qboolean SetTeam( gentity_t *ent, char *s ) {
// Kill him (makes sure he loses flags, etc)
ent->flags &= ~FL_GODMODE;
ent->client->ps.stats[STAT_HEALTH] = ent->health = 0;
player_die (ent, NULL, NULL, 100000, MOD_RESPAWN);
G_Client_Die (ent, NULL, NULL, 100000, MOD_RESPAWN);
}
// they go to the end of the line for tournements
@ -815,9 +815,9 @@ qboolean SetTeam( gentity_t *ent, char *s ) {
BroadcastTeamChange( client, oldTeam );
// get and distribute relevent paramters
ClientUserinfoChanged( clientNum );
G_Client_UserinfoChanged( clientNum );
ClientBegin( clientNum, qfalse, qfalse, qfalse );
G_Client_Begin( clientNum, qfalse, qfalse, qfalse );
return qtrue;
}
@ -953,7 +953,7 @@ qboolean SetClass( gentity_t *ent, char *s, char *teamName, qboolean SaveToCvar
else
{//not changing teams or couldn't change teams
// get and distribute relevent paramters
ClientUserinfoChanged( clientNum );
G_Client_UserinfoChanged( clientNum );
//if in the game already, kill and respawn him, else just wait to join
if ( sess->sessionTeam == TEAM_SPECTATOR )
@ -965,7 +965,7 @@ qboolean SetClass( gentity_t *ent, char *s, char *teamName, qboolean SaveToCvar
//RPG-X: RedTechie - No respawn for n00bs set all info and frap that a n00b needs HERE this eliminates respawns for n00bs
if(g_classData[pclass].isn00b/*pclass == PC_N00B*/){
ClientSpawn(ent, 1, qfalse);
G_Client_Spawn(ent, 1, qfalse);
ps->stats[STAT_WEAPONS] = ( 1 << WP_0 );
ps->stats[STAT_HOLDABLE_ITEM] = HI_NONE;
@ -990,8 +990,8 @@ qboolean SetClass( gentity_t *ent, char *s, char *teamName, qboolean SaveToCvar
ent->flags &= ~FL_GODMODE;
ps->stats[STAT_HEALTH] = ent->health = 0;
player_die (ent, NULL, NULL, 100000, MOD_RESPAWN);
ClientBegin( clientNum, qfalse, qfalse, qfalse );
G_Client_Die (ent, NULL, NULL, 100000, MOD_RESPAWN);
G_Client_Begin( clientNum, qfalse, qfalse, qfalse );
}
}
}
@ -1086,6 +1086,26 @@ static void Cmd_Team_f( gentity_t *ent ) {
ent->client->switchTeamTime = level.time + 2000;
}
/*
====================
Cmd_Ready_f
====================
*/
/**
* This function is called from the ui_sp_postgame.c as a result of clicking on the
* "next" button in non GT_TOURNAMENT games. This replaces the old system of waiting
* for the user to click an ATTACK or USE button to signal ready
* (see ClientIntermissionThink())
*
* when all clients have signaled ready, the game continues to the next match.
*/
void Cmd_Ready_f (gentity_t *ent)
{
gclient_t *client;
client = ent->client;
client->readyToExit = qtrue;
}
/*
=================
@ -2262,10 +2282,10 @@ static void Cmd_ForceKill_f( gentity_t *ent ) {
ps->stats[STAT_WEAPONS] = ( 1 << WP_0 );
ps->stats[STAT_HOLDABLE_ITEM] = HI_NONE;
ps->stats[STAT_HEALTH] = target->health = 1;
player_die (target, target, target, 100000, MOD_FORCEDSUICIDE);
G_Client_Die (target, target, target, 100000, MOD_FORCEDSUICIDE);
}else{
ps->stats[STAT_HEALTH] = target->health = 0;
player_die (target, target, target, 100000, MOD_FORCEDSUICIDE);
G_Client_Die (target, target, target, 100000, MOD_FORCEDSUICIDE);
}
} // end iterations
@ -2299,10 +2319,10 @@ static void Cmd_ForceKill_f( gentity_t *ent ) {
ps->stats[STAT_WEAPONS] = ( 1 << WP_0 );
ps->stats[STAT_HOLDABLE_ITEM] = HI_NONE;
ps->stats[STAT_HEALTH] = target->health = 1;
player_die (target, target, target, 100000, MOD_FORCEDSUICIDE);
G_Client_Die (target, target, target, 100000, MOD_FORCEDSUICIDE);
}else{
ps->stats[STAT_HEALTH] = target->health = 0;
player_die (target, target, target, 100000, MOD_FORCEDSUICIDE);
G_Client_Die (target, target, target, 100000, MOD_FORCEDSUICIDE);
}
Com_sprintf (send, sizeof(send), "%s ^7forced %s^7's death", ent->client->pers.netname, target->client->pers.netname);
@ -2433,10 +2453,10 @@ static void Cmd_ForceKillRadius_f( gentity_t *ent)
oPs->stats[STAT_WEAPONS] = ( 1 << WP_0 );
oPs->stats[STAT_HOLDABLE_ITEM] = HI_NONE;
oPs->stats[STAT_HEALTH] = OtherPlayer->health = 1;
player_die(OtherPlayer,OtherPlayer,OtherPlayer,100000, MOD_FORCEDSUICIDE);
G_Client_Die(OtherPlayer,OtherPlayer,OtherPlayer,100000, MOD_FORCEDSUICIDE);
}else{
oPs->stats[STAT_HEALTH] = OtherPlayer->health = 0;
player_die(OtherPlayer,OtherPlayer,OtherPlayer,100000, MOD_FORCEDSUICIDE);
G_Client_Die(OtherPlayer,OtherPlayer,OtherPlayer,100000, MOD_FORCEDSUICIDE);
}
}
@ -2453,10 +2473,10 @@ static void Cmd_ForceKillRadius_f( gentity_t *ent)
ePs->stats[STAT_WEAPONS] = ( 1 << WP_0 );
ePs->stats[STAT_HOLDABLE_ITEM] = HI_NONE;
ePs->stats[STAT_HEALTH] = ent->health = 1;
player_die(ent,ent,ent,100000, MOD_FORCEDSUICIDE);
G_Client_Die(ent,ent,ent,100000, MOD_FORCEDSUICIDE);
}else{
ePs->stats[STAT_HEALTH] = ent->health = 0;
player_die(ent,ent,ent,100000, MOD_FORCEDSUICIDE);
G_Client_Die(ent,ent,ent,100000, MOD_FORCEDSUICIDE);
}
}
@ -3122,7 +3142,7 @@ static void Cmd_AdminLogin_f( gentity_t *ent)
if(!arg[0] && ent->client->LoggedAsAdmin) {
ent->client->LoggedAsAdmin = qfalse;
trap_SendServerCommand( ent-g_entities, va("print \"You are now logged out.\n\"") );
ClientUserinfoChanged( ent-g_entities );
G_Client_UserinfoChanged( ent-g_entities );
return;
}
else if ( !arg[0] ) { //if user added no args (ie wanted the parameters)
@ -3140,7 +3160,7 @@ static void Cmd_AdminLogin_f( gentity_t *ent)
if ( IsAdmin( ent ) == qfalse ) {
ent->client->LoggedAsAdmin = qtrue;
trap_SendServerCommand( ent-g_entities, va("print \"You are logged in as an admin.\n\"") );
ClientUserinfoChanged( ent-g_entities );
G_Client_UserinfoChanged( ent-g_entities );
return;
} else {
trap_SendServerCommand( ent-g_entities, va("print \"You are already logged in as an admin or in the admin class.\n\"") );
@ -3233,7 +3253,7 @@ static void Cmd_Revive_f( gentity_t *ent)
{
if( (g_entities[i].client) && (g_entities[i].health == 1) && (g_entities[i].client->ps.pm_type == PM_DEAD))
{
ClientSpawn(&g_entities[i], 1, qtrue);
G_Client_Spawn(&g_entities[i], 1, qtrue);
ps = &g_entities[i].client->ps;
@ -3269,7 +3289,7 @@ static void Cmd_Revive_f( gentity_t *ent)
//Just me
if( (ent && ent->client) && (ent->health <= 1) && (ent->client->ps.pm_type == PM_DEAD))
{
ClientSpawn(ent, 1, qtrue);
G_Client_Spawn(ent, 1, qtrue);
ps = &ent->client->ps;
@ -3304,7 +3324,7 @@ static void Cmd_Revive_f( gentity_t *ent)
if( (other && other->client) && (other->health == 1) && (other->client->ps.pm_type == PM_DEAD))
{
ClientSpawn(other, 1, qtrue);
G_Client_Spawn(other, 1, qtrue);
ps = &other->client->ps;
@ -5549,7 +5569,7 @@ static void Cmd_Respawn_f(gentity_t *ent) {
if(!ent->client)
return;
ClientSpawn(ent, 0, qfalse);
G_Client_Spawn(ent, 0, qfalse);
if(ent->client->sess.sessionTeam != TEAM_SPECTATOR) {
ent->client->ps.powerups[PW_QUAD] = level.time + 4000;
tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TRANSPORT_IN );
@ -7425,10 +7445,10 @@ void Cmd_CamtestEnd_f(gentity_t *ent) {
/*
=================
ClientCommand
G_Client_Command
=================
*/
void ClientCommand( int clientNum )
void G_Client_Command( int clientNum )
{
gentity_t *ent;
char cmd[MAX_TOKEN_CHARS];

View File

@ -11,12 +11,12 @@ extern void SetClass( gentity_t *ent, char *s, char *teamName, qboolean SaveToCv
/*
============
AddScore
G_Client_AddScore
Adds score to both the client and his team
============
*/
void AddScore( gentity_t *ent, int score ) {
void G_Client_AddScore( gentity_t *ent, int score ) {
if ( !ent )
{
return;
@ -36,7 +36,7 @@ void AddScore( gentity_t *ent, int score ) {
{//this isn't capture score
level.teamScores[ ent->client->ps.persistant[PERS_TEAM] ] += score;
}
CalculateRanks( qfalse );
G_Client_CalculateRanks( qfalse );
//RPG-X: RedTechie - Lets enable score updating without this scores will not be updated
ent->client->UpdateScore = qfalse;
@ -64,7 +64,7 @@ void SetScore( gentity_t *ent, int score ) {
}
ent->client->ps.persistant[PERS_SCORE] = score;
CalculateRanks( qfalse );
G_Client_CalculateRanks( qfalse );
// TiM: send the current scoring to all clients
SendScoreboardMessageToAllClients();
@ -251,14 +251,14 @@ extern void DetonateDetpack(gentity_t *ent);
/*
==================
player_die
G_Client_Die
Heavly Modifyed By: RedTechie
RPG-X: Marcin: a little bit modified - 30/12/2008
==================
*/
extern char *ClassNameForValue( pclass_t pClass );
extern qboolean IsAdmin( gentity_t *ent);
void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ) {
void G_Client_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ) {
//---------------------
//RPG-X: RedTechie - Check to see if medics revive people and not respawn if true use my fake death insead :)
//---------------------
@ -479,11 +479,11 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
BG_PlayerStateToEntityState( &self->client->ps, &self->s, qtrue );
ClientUserinfoChanged( self->s.clientNum );
G_Client_UserinfoChanged( self->s.clientNum );
ClientEndFrame( self );
G_StoreClientInitialStatus( self );
G_Client_StoreClientInitialStatus( self );
//---------------------
//RPG-X: RedTechie - If it dose equal 0 use regular die
//---------------------
@ -605,13 +605,13 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
{
if ( meansOfDeath != MOD_RESPAWN )
{//just changing class
AddScore( attacker, -1 );
G_Client_AddScore( attacker, -1 );
}
}
else
{
attacker->client->pers.teamState.frags++;
AddScore( attacker, 1 );
G_Client_AddScore( attacker, 1 );
// Check to see if the player is on a streak.
attacker->client->streakCount++;
@ -623,7 +623,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
{
if ( meansOfDeath != MOD_RESPAWN )
{//not just changing class
AddScore( self, -1 );
G_Client_AddScore( self, -1 );
}
}
////////////////////////////////////////////////////////////////////////
@ -1349,7 +1349,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_0 ); //?!!!!!
client->ps.stats[STAT_HOLDABLE_ITEM] = HI_NONE;
targ->health = 1;
player_die( targ, inflictor, attacker, take, mod );
G_Client_Die( targ, inflictor, attacker, take, mod );
}
}else{
if ( targ->health <= 0 ) {
@ -1512,7 +1512,7 @@ qboolean G_RadiusDamage ( vec3_t origin, gentity_t *attacker, float damage, floa
}
}
if( LogAccuracyHit( ent, attacker ) ) {
if( G_Weapon_LogAccuracyHit( ent, attacker ) ) {
hitClient = qtrue;
}
VectorSubtract (ent->r.currentOrigin, origin, dir);

View File

@ -480,7 +480,7 @@ void SetScore( gentity_t *ent, int score );
/**
* \brief client data that stays across multiple respawns,
*
* but is cleared on each level change or team change at ClientBegin()
* but is cleared on each level change or team change at G_Client_Begin()
*/
typedef struct {
clientConnected_t connected;
@ -502,7 +502,7 @@ typedef struct {
/** \struct gclient_s
*
* this structure is cleared on each ClientSpawn(),
* this structure is cleared on each G_Client_Spawn(),
* except for 'client->pers' and 'client->sess'
*/
struct gclient_s {
@ -727,6 +727,7 @@ void StopFollowing( gentity_t *ent );
void BroadcastTeamChange( gclient_t *client, int oldTeam );
qboolean SetTeam( gentity_t *ent, char *s );
void Cmd_FollowCycle_f( gentity_t *ent, int dir );
void Cmd_Ready_f (gentity_t *ent);
//
// g_roff.c
@ -853,8 +854,7 @@ void G_Repair(gentity_t *ent, gentity_t *tr_ent, float rate); //RPG-X | GSIO01 |
//
// g_missile.c
//
void G_RunMissile( gentity_t *ent );
void G_Missile_Run( gentity_t *ent );
gentity_t *fire_blaster (gentity_t *self, vec3_t start, vec3_t aimdir);
gentity_t *fire_plasma (gentity_t *self, vec3_t start, vec3_t aimdir);
gentity_t *fire_quantum (gentity_t *self, vec3_t start, vec3_t aimdir);
@ -862,16 +862,15 @@ gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t aimdir);
gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir);
gentity_t *fire_grapple (gentity_t *self, vec3_t start, vec3_t dir);
gentity_t *fire_comprifle (gentity_t *self, vec3_t start, vec3_t dir);
//RPG-X: - RedTechie Added this for curiosity
void ShieldRemove(gentity_t *self);
//
// g_mover.c
//
void G_RunMover( gentity_t *ent );
void Touch_DoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace );
void Use_BinaryMover( gentity_t *ent, gentity_t *other, gentity_t *activator );
void G_Mover_Run( gentity_t *ent );
void G_Mover_TouchDoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace );
void G_Mover_UseBinaryMover( gentity_t *ent, gentity_t *other, gentity_t *activator );
//
// g_trigger.c
@ -891,38 +890,105 @@ void target_turbolift_start( gentity_t *ent );
//
// g_weapon.c
//
qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker );
void CalcMuzzlePoint ( gentity_t *ent, vec3_t forward, vec3_t right, vec3_t up, vec3_t muzzlePoint, float projsize);
void SnapVectorTowards( vec3_t v, vec3_t to );
//qboolean SeekerAcquiresTarget ( gentity_t *ent, vec3_t pos );
//void FireSeeker( gentity_t *owner, gentity_t *target, vec3_t origin);
qboolean G_Weapon_LogAccuracyHit( gentity_t *target, gentity_t *attacker );
void G_Weapon_CalcMuzzlePoint ( gentity_t *ent, vec3_t forward, vec3_t right, vec3_t up, vec3_t muzzlePoint, float projsize);
void G_Weapon_SnapVectorTowards( vec3_t v, vec3_t to );
//
// g_client.c
//
team_t TeamCount( int ignoreClientNum, int team );
team_t PickTeam( int ignoreClientNum );
void SetClientViewAngle( gentity_t *ent, vec3_t angle );
gentity_t *SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles );
void respawn (gentity_t *ent);
void BeginIntermission (void);
void InitClientPersistant (gclient_t *client);
void InitClientResp (gclient_t *client);
void InitBodyQue (void);
void ClientSpawn( gentity_t *ent, int rpgx_spawn, qboolean fromDeath );
void player_die (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod);
void AddScore( gentity_t *ent, int score );
void CalculateRanks( qboolean fromExit );
qboolean SpotWouldTelefrag( gentity_t *spot );
//RPG-X: RedTechie - Class info
//void ClientMaxHealthForClass ( gclient_t *client, pclass_t pclass );
//void ClientPowerupsForClass ( gentity_t *ent, pclass_t pclass );
void ClientWeaponsForClass ( gclient_t *client, pclass_t pclass );
void ClientHoldablesForClass ( gclient_t *client, pclass_t pclass );
void G_StoreClientInitialStatus( gentity_t *ent );
/**
* Get number of clients in team.
*/
team_t G_Client_TeamCount( int ignoreClientNum, int team );
/**
* Pick a random team.
*/
team_t G_Client_PickTeam( int ignoreClientNum );
/**
* Set the clients view angle.
*/
void G_Client_SetViewAngle( gentity_t *ent, vec3_t angle );
/**
* Select a spawnpoint.
*/
gentity_t* G_Client_SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles );
/**
* Respawn client.
*/
void G_Client_Respawn(gentity_t *ent);
/**
* Begin intermission.
*/
void G_Client_BeginIntermission(void);
/**
* Init the body que.
*/
void G_Client_InitBodyQue(void);
/**
* Spawn client.
*/
void G_Client_Spawn( gentity_t *ent, int rpgx_spawn, qboolean fromDeath );
/**
* Let the client die.
*/
void G_Client_Die (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod);
/**
* Add score for the client.
*/
void G_Client_AddScore( gentity_t *ent, int score );
/**
* Calculate clients ranks.
*/
void G_Client_CalculateRanks( qboolean fromExit );
/**
* Determine whether spot would telefrag.
*/
qboolean G_Client_SpotWouldTelefrag( gentity_t *spot );
/**
* Get weapons for a class.
*/
void G_Client_WeaponsForClass( gclient_t *client, pclass_t pclass );
/**
* Get holdable items for a class.
*/
void G_Client_HoldablesForClass( gclient_t *client, pclass_t pclass );
/**
* Store the clients initial status.
*/
void G_Client_StoreClientInitialStatus( gentity_t *ent );
/**
* Get location message for a client.
*/
qboolean G_Client_GetLocationMsg(gentity_t *ent, char *loc, int loclen);
/**
* Check client statuses.
*/
void G_Client_CheckClientStatus(void);
/**
* Send client location information.
*/
void G_Client_LocationsMessage( gentity_t *ent );
/**
* Client connect.
*/
char* G_Client_Connect( int clientNum, qboolean firstTime, qboolean isBot );
/**
* Clients user info changed.
*/
void G_Client_UserinfoChanged( int clientNum );
/**
* Disconnect client.
*/
void G_Client_Disconnect( int clientNum );
/**
* Initialize client.
*/
void G_Client_Begin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qboolean first );
/**
* Client command.
*/
void G_Client_Command( int clientNum );
//
// g_svcmds.c
@ -1131,18 +1197,57 @@ typedef enum
#define AWARDS_MSG_LENGTH 256
/**
* Print message to log.
*/
void QDECL G_LogPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
/**
* Log weapon pickup.
*/
void QDECL G_LogWeaponPickup(int client, int weaponid);
/**
* Log weapon fire.
*/
void QDECL G_LogWeaponFire(int client, int weaponid);
/**
* Log weapon damage.
*/
void QDECL G_LogWeaponDamage(int client, int mod, int amount);
/**
* Log weapon kill.
*/
void QDECL G_LogWeaponKill(int client, int mod);
/**
* Log weapon death.
*/
void QDECL G_LogWeaponDeath(int client, int weaponid);
/**
* Log weapon frag.
*/
void QDECL G_LogWeaponFrag(int attacker, int deadguy);
/**
* Log weapon powerup.
*/
void QDECL G_LogWeaponPowerup(int client, int powerupid);
/**
* Log weapon item.
*/
void QDECL G_LogWeaponItem(int client, int itemid);
/**
* Log weapon init.
*/
void QDECL G_LogWeaponInit(void);
/**
* Log weapon output.
*/
void QDECL G_LogWeaponOutput(void);
/**
* Log exit.
*/
void QDECL G_LogExit( const char *string );
/**
* Clear client log.
*/
void QDECL G_ClearClientLog(int client);
void CalculateAwards(gentity_t *ent, char *msg);
@ -1153,17 +1258,7 @@ int GetFavoriteTargetForClient(int nClient);
int GetWorstEnemyForClient(int nClient);
int GetFavoriteWeaponForClient(int nClient);
//
// g_client.c
//
char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot );
//TiM - changed to allow override of 'clampinfo'
void ClientUserinfoChanged( int clientNum );
void ClientDisconnect( int clientNum );
void ClientBegin( int clientNum, qboolean careAboutWarmup, qboolean isBot, qboolean first );
void ClientCommand( int clientNum );
/*----------------------------------------------------------------------------------------*/
//TiM - Delayed Transport Beam
void G_InitTransport( int clientNum, vec3_t origin, vec3_t angles );
@ -1183,10 +1278,10 @@ typedef struct
// g_active.c
//
void ClientThink( int clientNum );
void ClientEndFrame( gentity_t *ent );
void G_RunClient( gentity_t *ent );
void Cmd_Ready_f (gentity_t *ent);
void ClientThink( int clientNum ); // TODO move me to g_client.c
void ClientEndFrame( gentity_t *ent ); // TODO move me to g_client.c
void G_RunClient( gentity_t *ent ); // TODO move me to g_client.c
void G_Active_ShieldRemove(gentity_t *self);
//RPG-X | Marcin | 03/12/2008
void ThrowWeapon( gentity_t *ent, char *txt );

View File

@ -514,21 +514,21 @@ intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4,
G_ShutdownGame( arg0 );
return 0;
case GAME_CLIENT_CONNECT:
return (size_t)ClientConnect( arg0, (qboolean)arg1, (qboolean)arg2 );
return (size_t)G_Client_Connect( arg0, (qboolean)arg1, (qboolean)arg2 );
case GAME_CLIENT_THINK:
ClientThink( arg0 );
return 0;
case GAME_CLIENT_USERINFO_CHANGED:
ClientUserinfoChanged( arg0 ); //TiM - this means a user just tried to change it
G_Client_UserinfoChanged( arg0 ); //TiM - this means a user just tried to change it
return 0;
case GAME_CLIENT_DISCONNECT:
ClientDisconnect( arg0 );
G_Client_Disconnect( arg0 );
return 0;
case GAME_CLIENT_BEGIN:
ClientBegin( arg0, qtrue, qfalse, qtrue );
G_Client_Begin( arg0, qtrue, qfalse, qtrue );
return 0;
case GAME_CLIENT_COMMAND:
ClientCommand( arg0 );
G_Client_Command( arg0 );
return 0;
case GAME_RUN_FRAME:
G_RunFrame( arg0 );
@ -1825,7 +1825,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
&level.clients[0].ps, sizeof( level.clients[0] ) );
// reserve some spots for dead player bodies
InitBodyQue();
G_Client_InitBodyQue();
ClearRegisteredItems();
@ -2079,13 +2079,13 @@ static void AdjustTournamentScores( void ) {
clientNum = level.sortedClients[0];
if ( level.clients[ clientNum ].pers.connected == CON_CONNECTED ) {
level.clients[ clientNum ].sess.wins++;
ClientUserinfoChanged( clientNum );
G_Client_UserinfoChanged( clientNum );
}
clientNum = level.sortedClients[1];
if ( level.clients[ clientNum ].pers.connected == CON_CONNECTED ) {
level.clients[ clientNum ].sess.losses++;
ClientUserinfoChanged( clientNum );
G_Client_UserinfoChanged( clientNum );
}
}
@ -2160,7 +2160,7 @@ int QDECL SortRanks( const void *a, const void *b ) {
/*
============
CalculateRanks
G_Client_CalculateRanks
Recalculates the score ranks of all players
This will be called on every client connect, begin, disconnect, death,
@ -2169,7 +2169,7 @@ and team change.
FIXME: for elimination, the last man standing must be ranked first
============
*/
void CalculateRanks( qboolean fromExit ) {
void G_Client_CalculateRanks( qboolean fromExit ) {
int i;
int rank;
int score;
@ -2286,7 +2286,7 @@ MAP CHANGING
========================
SendScoreboardMessageToAllClients
Do this at BeginIntermission time and whenever ranks are recalculated
Do this at G_Client_BeginIntermission time and whenever ranks are recalculated
due to enters/exits/forced team changes
========================
*/
@ -2351,7 +2351,7 @@ void FindIntermissionPoint( void ) {
// find the intermission spot
ent = G_Find (NULL, FOFS(classname), "info_player_intermission");
if ( !ent ) { // the map creator forgot to put in an intermission point...
SelectSpawnPoint ( vec3_origin, level.intermission_origin, level.intermission_angle );
G_Client_SelectSpawnPoint ( vec3_origin, level.intermission_origin, level.intermission_angle );
} else {
VectorCopy (ent->s.origin, level.intermission_origin);
VectorCopy (ent->s.angles, level.intermission_angle);
@ -2392,10 +2392,10 @@ static void ClearFiringFlags(void)
/*
==================
BeginIntermission
G_Client_BeginIntermission
==================
*/
void BeginIntermission( void ) {
void G_Client_BeginIntermission( void ) {
int i;
gentity_t *client;
qboolean doingLevelshot;
@ -2434,7 +2434,7 @@ void BeginIntermission( void ) {
if (!client->inuse)
continue;
if (client->health <= 0) {
respawn(client);
G_Client_Respawn(client);
}
MoveClientToIntermission( client );
@ -2717,7 +2717,7 @@ void G_RunFrame( int levelTime ) {
}
if ( (es->eType == ET_MISSILE) || (es->eType == ET_ALT_MISSILE) ) {
G_RunMissile( ent );
G_Missile_Run( ent );
continue;
}
@ -2727,7 +2727,7 @@ void G_RunFrame( int levelTime ) {
}
if ( es->eType == ET_MOVER || es->eType == ET_MOVER_STR ) { //RPG-X | GSIO01 | 13/05/2009
G_RunMover( ent );
G_Mover_Run( ent );
continue;
}

View File

@ -96,7 +96,7 @@ void TransportPlayer( gentity_t *player, vec3_t origin, vec3_t angles, int speed
ps->eFlags ^= EF_TELEPORT_BIT;
// set angles
SetClientViewAngle( player, angles );
G_Client_SetViewAngle( player, angles );
// kill anything at the destination
if ( sess->sessionTeam != TEAM_SPECTATOR /*&& !(ps->eFlags&EF_ELIMINATED)*/) {
@ -204,7 +204,7 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles, tpType_t t
ps->eFlags ^= EF_TELEPORT_BIT;
// set angles
SetClientViewAngle( player, angles );
G_Client_SetViewAngle( player, angles );
// kill anything at the destination
if ( sess->sessionTeam != TEAM_SPECTATOR ) {

View File

@ -237,10 +237,10 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
if(other && ((other->classname && !Q_stricmp(other->classname, "holdable_shield")))){
if(IsAdmin(ent->parent)){
G_FreeEntity(ent);
ShieldRemove(other);
G_Active_ShieldRemove(other);
return;
}else{
// can't call grenadeSpewShrapnel right here or G_RunMissile will puke
// can't call grenadeSpewShrapnel right here or G_Missile_Run will puke
ent->think = grenadeSpewShrapnel;
// set our next think to right now. our think fn will get called this frame.
ent->nextthink = level.time;
@ -248,7 +248,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
return;
}
}else{
// can't call grenadeSpewShrapnel right here or G_RunMissile will puke
// can't call grenadeSpewShrapnel right here or G_Missile_Run will puke
ent->think = grenadeSpewShrapnel;
// set our next think to right now. our think fn will get called this frame.
ent->nextthink = level.time;
@ -301,7 +301,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
// change over to a normal entity right at the point of impact
ent->s.eType = ET_GENERAL;
SnapVectorTowards( trace->endpos, ent->s.pos.trBase ); // save net bandwidth
G_Weapon_SnapVectorTowards( trace->endpos, ent->s.pos.trBase ); // save net bandwidth
G_SetOrigin( ent, trace->endpos );
@ -367,11 +367,11 @@ static void G_RunStuckMissile( gentity_t *ent )
/*
================
G_RunMissile
G_Missile_Run
================
*/
void G_RunMissile( gentity_t *ent ) {
void G_Missile_Run( gentity_t *ent ) {
vec3_t origin;
trace_t tr;

View File

@ -359,11 +359,11 @@ static void G_MoverTeam( gentity_t *ent ) {
/*
================
G_RunMover
G_Mover_Run
================
*/
void G_RunMover( gentity_t *ent ) {
void G_Mover_Run( gentity_t *ent ) {
// if not a team captain, don't do anything, because
// the captain will handle everything
if ( ent->flags & FL_TEAMSLAVE ) {
@ -703,7 +703,7 @@ void Reached_BinaryMover( gentity_t *ent ) {
}
if ( ent->wait < 0 )
ent->use = Use_BinaryMover;
ent->use = G_Mover_UseBinaryMover;
// close areaportals
if ( ent->teammaster == ent || !ent->teammaster ) {
@ -745,7 +745,7 @@ void Reached_BinaryMover( gentity_t *ent ) {
}
if(ent->wait < 0)
ent->use = Use_BinaryMover;
ent->use = G_Mover_UseBinaryMover;
// close areaportals
if ( ent->teammaster == ent || !ent->teammaster ) {
@ -777,10 +777,10 @@ void Reached_BinaryMover( gentity_t *ent ) {
/*
================
Use_BinaryMover
G_Mover_UseBinaryMover
================
*/
void Use_BinaryMover( gentity_t *ent, gentity_t *other, gentity_t *activator ) {
void G_Mover_UseBinaryMover( gentity_t *ent, gentity_t *other, gentity_t *activator ) {
int total;
int partial;
@ -825,7 +825,7 @@ void Use_BinaryMover( gentity_t *ent, gentity_t *other, gentity_t *activator ) {
// only the master should be used
if ( ent->flags & FL_TEAMSLAVE ) {
Use_BinaryMover( ent->teammaster, other, activator );
G_Mover_UseBinaryMover( ent->teammaster, other, activator );
return;
}
@ -1017,7 +1017,7 @@ void InitMover( gentity_t *ent ) {
}
ent->use = Use_BinaryMover;
ent->use = G_Mover_UseBinaryMover;
if(Q_stricmp(ent->classname, "func_mover"))
ent->reached = Reached_BinaryMover;
else
@ -1126,7 +1126,7 @@ void InitRotator( gentity_t *ent ) {
}
ent->use = Use_BinaryMover;
ent->use = G_Mover_UseBinaryMover;
ent->reached = Reached_BinaryMover;
ent->moverState = ROTATOR_POS1;
@ -1184,7 +1184,7 @@ void Blocked_Door( gentity_t *ent, gentity_t *other ) {
}
// reverse direction
Use_BinaryMover( ent, ent, other );
G_Mover_UseBinaryMover( ent, ent, other );
}
/*
@ -1219,10 +1219,10 @@ void DoorTriggerReactivate(gentity_t *ent);
/*
================
Touch_DoorTrigger
G_Mover_TouchDoorTrigger
================
*/
void Touch_DoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace ) {
void G_Mover_TouchDoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace ) {
#if 0
vec3_t vec, doorcenter, movedir;
float dot, dist ;
@ -1270,7 +1270,7 @@ void Touch_DoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace ) {
else if ( ent->parent->moverState != MOVER_1TO2 &&
ent->parent->moverState != ROTATOR_1TO2 )
{
Use_BinaryMover( ent->parent, ent, other );
G_Mover_UseBinaryMover( ent->parent, ent, other );
}
if(ent->parent->flags & FL_LOCKED) {
ent->touch = 0;
@ -1279,7 +1279,7 @@ void Touch_DoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace ) {
}
void DoorTriggerReactivate(gentity_t *ent) {
ent->touch = Touch_DoorTrigger;
ent->touch = G_Mover_TouchDoorTrigger;
ent->nextthink = -1;
}
@ -1348,7 +1348,7 @@ void Think_SpawnNewDoorTrigger( gentity_t *ent ) {
VectorCopy (maxs, other->r.maxs);
other->parent = ent;
other->r.contents = CONTENTS_TRIGGER;
other->touch = Touch_DoorTrigger;
other->touch = G_Mover_TouchDoorTrigger;
// remember the thinnest axis
other->count = best;
//RPG-X | GSIO01 | 08/05/2009 | SOE = START OF EDIT ... lol
@ -1620,13 +1620,13 @@ void Touch_PlatCenterTrigger(gentity_t *ent, gentity_t *other, trace_t *trace )
#endif
if ( ent->parent->moverState == MOVER_POS1 ) {
Use_BinaryMover( ent->parent, ent, other );
G_Mover_UseBinaryMover( ent->parent, ent, other );
}
}
void func_plat_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
if (ent->parent->moverState == MOVER_POS1 ) {
Use_BinaryMover(ent->parent, other, activator);
G_Mover_UseBinaryMover(ent->parent, other, activator);
}
}
@ -1770,7 +1770,7 @@ void Touch_Button(gentity_t *ent, gentity_t *other, trace_t *trace ) {
#endif
if ( ent->moverState == MOVER_POS1 ) {
Use_BinaryMover( ent, other, other );
G_Mover_UseBinaryMover( ent, other, other );
}
}
@ -2446,7 +2446,7 @@ void SP_func_rotating (gentity_t *ent) {
ent->distance = 0;
}
//ent->use = func_rotating_use; //RPG-X | GSIO01 --- weren't you aware that InitMover sets the use func to Use_BinaryMover Phenix??
//ent->use = func_rotating_use; //RPG-X | GSIO01 --- weren't you aware that InitMover sets the use func to G_Mover_UseBinaryMover Phenix??
if (!ent->booleanstate)
{
@ -2963,7 +2963,7 @@ ADVANCED MOVER
*/
void Move_AdvancedMover(gentity_t *ent) {
Use_BinaryMover(ent, NULL, ent->activator);
G_Mover_UseBinaryMover(ent, NULL, ent->activator);
}
@ -3000,7 +3000,7 @@ void Reached_AdvancedMover(gentity_t *ent) {
if( touched->wait < 0) {
ent->nextthink = -1; // wait here until used again
ent->use = Use_BinaryMover;
ent->use = G_Mover_UseBinaryMover;
if(ent->damage) {
temp = G_Find(NULL, FOFS(targetname), touched->target);
if(!temp) {

View File

@ -70,7 +70,7 @@ into a wall.
@param v vector to round
@param to rounded vector
*/
void SnapVectorTowards( vec3_t v, vec3_t to ) {
void G_Weapon_SnapVectorTowards( vec3_t v, vec3_t to ) {
int i;
for ( i = 0 ; i < 3 ; i++ ) {
@ -1318,7 +1318,7 @@ static void WP_FireQuantumBurst( gentity_t *ent, qboolean alt_fire )
* @param target the target entity
* @param attacker the attacker entity
*/
qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker ) {
qboolean G_Weapon_LogAccuracyHit( gentity_t *target, gentity_t *attacker ) {
if( !target->takedamage ) {
return qfalse;
}
@ -1394,7 +1394,7 @@ static void CorrectForwardVector(gentity_t *ent, vec3_t fwd, vec3_t muzzlePoint,
/*
===============
CalcMuzzlePoint
G_Weapon_CalcMuzzlePoint
set muzzle location relative to pivoting eye
===============
@ -1493,7 +1493,7 @@ static float WP_ShotAltSize[WP_NUM_WEAPONS] =
* @param muzzlePoint the muzzle point
* @param projsize projsize
*/
void CalcMuzzlePoint ( gentity_t *ent, vec3_t fwd, vec3_t rt, vec3_t vup, vec3_t muzzlePoint, float projsize)
void G_Weapon_CalcMuzzlePoint ( gentity_t *ent, vec3_t fwd, vec3_t rt, vec3_t vup, vec3_t muzzlePoint, float projsize)
{
int weapontype;
@ -1669,7 +1669,7 @@ static void WP_SprayVoyagerHypo( gentity_t *ent, qboolean alt_fire )
if( (tr_ent && tr_ent->client) && (tr_ent->health == 1) && (tr_ent->client->ps.pm_type == PM_DEAD)){
tr_entPs = &tr_ent->client->ps;
if(rpg_medicsrevive.integer == 1){
ClientSpawn(tr_ent, 1, qtrue);
G_Client_Spawn(tr_ent, 1, qtrue);
/* TiM : Hard coded emote. Makes the player play a 'get up' animation :) */
/* G_MoveBox( tr_ent ); */
@ -1692,7 +1692,7 @@ static void WP_SprayVoyagerHypo( gentity_t *ent, qboolean alt_fire )
tr_entPs = &tr_ent->client->ps;
if(alt_fire && rpg_hypoMelee.integer) { /* alt fire and hypo melee enabled */
tr_ent->health = 0;
player_die( tr_ent, ent, ent, 100, MOD_KNOCKOUT );
G_Client_Die( tr_ent, ent, ent, 100, MOD_KNOCKOUT );
G_LogWeaponFire( ent->s.number, WP_12 );
} else { /* else just heal */
if ( tr_ent->health < tr_entPs->stats[STAT_MAX_HEALTH] )
@ -1742,7 +1742,7 @@ void FireWeapon( gentity_t *ent, qboolean alt_fire )
{
projsize = WP_ShotSize[ent->s.weapon];
}
CalcMuzzlePoint ( ent, forward, right, up, muzzle, projsize);
G_Weapon_CalcMuzzlePoint ( ent, forward, right, up, muzzle, projsize);
/* fire the specific weapon */
switch( ent->s.weapon )