mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-02-23 20:41:11 +00:00
updates to g_client.c
This commit is contained in:
parent
ed460d0bb1
commit
34a3de38f3
1 changed files with 901 additions and 816 deletions
|
@ -17,6 +17,10 @@
|
|||
extern int32_t AI_main_BotAISetupClient(int32_t client, bot_settings_t* settings);
|
||||
extern int32_t AI_main_BotAIShutdownClient(int32_t client);
|
||||
|
||||
enum g_clientLimits_e {
|
||||
MAX_SPAWN_POINTS = 256
|
||||
};
|
||||
|
||||
reconData_t g_reconData[MAX_RECON_NAMES]; //!< recon data for a limited ammount of clients
|
||||
int32_t g_reconNum;
|
||||
|
||||
|
@ -147,7 +151,6 @@ SelectNearestDeathmatchSpawnPoint
|
|||
Find the spot that we DON'T want to use
|
||||
================
|
||||
*/
|
||||
#define MAX_SPAWN_POINTS 256
|
||||
/**
|
||||
* Find the spot that we DON'T want to use
|
||||
*/
|
||||
|
@ -179,7 +182,6 @@ SelectRandomDeathmatchSpawnPoint
|
|||
go to a random point that doesn't telefrag
|
||||
================
|
||||
*/
|
||||
#define MAX_SPAWN_POINTS 256
|
||||
/**
|
||||
* go to a random point that doesn't telefrag
|
||||
*/
|
||||
|
@ -391,7 +393,8 @@ static void CopyToBodyQue( gentity_t *ent ) {
|
|||
eState->pos.trType = TR_GRAVITY;
|
||||
eState->pos.trTime = level.time;
|
||||
VectorCopy(ent->client->ps.velocity, eState->pos.trDelta);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
eState->pos.trType = TR_STATIONARY;
|
||||
}
|
||||
eState->event = 0;
|
||||
|
@ -440,10 +443,12 @@ static void CopyToBodyQue( gentity_t *ent ) {
|
|||
if (rpg_medicsrevive.integer == 0){
|
||||
if (ent->health <= GIB_HEALTH) {
|
||||
body->takedamage = qfalse;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
body->takedamage = qtrue;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
body->takedamage = qfalse;
|
||||
}
|
||||
|
||||
|
@ -493,7 +498,8 @@ void G_Client_Respawn( gentity_t *ent ) {
|
|||
// add a teleportation effect
|
||||
if (borg) {
|
||||
tent = G_TempEntity(ps->origin, EV_BORG_TELEPORT);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
tent = G_TempEntity(ps->origin, EV_PLAYER_TRANSPORT_IN);
|
||||
ps->powerups[PW_QUAD] = level.time + 4000;
|
||||
}
|
||||
|
@ -578,7 +584,8 @@ static void ForceClientSkin(char* model, const char* skin ) {
|
|||
strncat(model, "main", MAX_QPATH);
|
||||
strncat(model, "/", MAX_QPATH);
|
||||
strncat(model, skin, MAX_QPATH);
|
||||
} else { //ie we got a slash (which should be the first of two
|
||||
}
|
||||
else { //ie we got a slash (which should be the first of two
|
||||
p++;
|
||||
q = strchr(p, '/'); //okay, we should get another one if one was already found
|
||||
if (q == NULL || q[0] == 0 || q[1] == 0)
|
||||
|
@ -587,7 +594,8 @@ static void ForceClientSkin(char* model, const char* skin ) {
|
|||
//so just add the skin to the end :P
|
||||
strncat(model, "/", MAX_QPATH);
|
||||
strncat(model, skin, MAX_QPATH);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
q++;
|
||||
*q = '\0';
|
||||
strncat(model, skin, MAX_QPATH);
|
||||
|
@ -841,7 +849,8 @@ static void randomSkin(const char* race, char* model, int32_t current_team, int3
|
|||
if (howManySkins > 0) {
|
||||
temp = rand() % howManySkins;
|
||||
Q_strncpyz(model, skinsForRace[temp], MAX_QPATH);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
model[0] = 0;
|
||||
}
|
||||
|
||||
|
@ -950,7 +959,8 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
s = Info_ValueForKey(userinfo, "cg_predictItems");
|
||||
if (atoi(s) == 0) {
|
||||
pers->predictItemPickup = qfalse;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
pers->predictItemPickup = qtrue;
|
||||
}
|
||||
|
||||
|
@ -1024,7 +1034,8 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
if ((g_gametype.integer < GT_TEAM) || (Q_stricmp("", g_team_group_red.string) == 0)) {
|
||||
ForceClientSkin(model, "red");
|
||||
break;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// at this point, we are playing CTF and there IS a race specified for this game
|
||||
reset = getNewSkin(g_team_group_red.string, model, "red", client, clientNum);
|
||||
|
||||
|
@ -1063,7 +1074,8 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
if ((g_gametype.integer < GT_TEAM) || (Q_stricmp("", g_team_group_blue.string) == 0)) {
|
||||
ForceClientSkin(model, "blue");
|
||||
break;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// at this point, we are playing CTF and there IS a race specified for this game
|
||||
// go away and get what ever races this skin is attached to.
|
||||
reset = getNewSkin(g_team_group_blue.string, model, "blue", client, clientNum);
|
||||
|
@ -1115,7 +1127,8 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
s = Info_ValueForKey(userinfo, "noAdminChat");
|
||||
if (atoi(s) > 0) {
|
||||
client->noAdminChat = qtrue;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
client->noAdminChat = qfalse;
|
||||
}
|
||||
|
||||
|
@ -1123,7 +1136,8 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
s = Info_ValueForKey(userinfo, "teamoverlay");
|
||||
if (!*s || atoi(s) != 0) {
|
||||
pers->teamInfo = qtrue;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
pers->teamInfo = qfalse;
|
||||
}
|
||||
|
||||
|
@ -1132,9 +1146,11 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
height = atof(s);
|
||||
if (height > (float)rpg_maxHeight.value) {
|
||||
Q_strncpyz(sHeight, rpg_maxHeight.string, sizeof(sHeight));
|
||||
} else if (height < (float)rpg_minHeight.value ) {
|
||||
}
|
||||
else if (height < (float)rpg_minHeight.value) {
|
||||
Q_strncpyz(sHeight, rpg_minHeight.string, sizeof(sHeight));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Q_strncpyz(sHeight, s, sizeof(sHeight));
|
||||
}
|
||||
|
||||
|
@ -1146,9 +1162,11 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
weight = atof(s);
|
||||
if (weight > (float)rpg_maxWeight.value) {
|
||||
Q_strncpyz(sWeight, rpg_maxWeight.string, sizeof(sWeight));
|
||||
} else if (weight < (float)rpg_minWeight.value ) {
|
||||
}
|
||||
else if (weight < (float)rpg_minWeight.value) {
|
||||
Q_strncpyz(sWeight, rpg_minWeight.string, sizeof(sWeight));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Q_strncpyz(sWeight, s, sizeof(sWeight));
|
||||
}
|
||||
|
||||
|
@ -1170,7 +1188,8 @@ void G_Client_UserinfoChanged( int32_t clientNum ) {
|
|||
pers->maxHealth, sess->wins, sess->losses,
|
||||
Info_ValueForKey(userinfo, "skill"),
|
||||
sHeight, sWeight, modelOffset);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s = va("n\\%s\\t\\%i\\p\\%i\\model\\%s\\hc\\%i\\w\\%i\\l\\%i\\age\\%s\\height\\%s\\weight\\%s\\race\\%s\\of\\%i\\admin\\%i",
|
||||
pers->netname, sess->sessionTeam, sess->sessionClass, model,
|
||||
pers->maxHealth, sess->wins, sess->losses, age,
|
||||
|
@ -1309,7 +1328,8 @@ char* G_Client_Connect( int32_t clientNum, qboolean firstTime, qboolean isBot )
|
|||
if (isBot) {
|
||||
client->sess.sessionClass = 0;
|
||||
client->ps.persistant[PERS_SCORE] = 1;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
int32_t tmpScore = 0;
|
||||
int32_t i = 0;
|
||||
qboolean changeRank = qfalse;
|
||||
|
@ -1325,7 +1345,8 @@ char* G_Client_Connect( int32_t clientNum, qboolean firstTime, qboolean isBot )
|
|||
if (client->sess.sessionClass < 0) {
|
||||
client->sess.sessionClass = 0;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
client->sess.sessionClass = 0;
|
||||
}
|
||||
|
||||
|
@ -1339,7 +1360,8 @@ char* G_Client_Connect( int32_t clientNum, qboolean firstTime, qboolean isBot )
|
|||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ((rpg_startingRank.string[0] != 0) && (Q_stricmp(g_rankNames[i].consoleName, rpg_startingRank.string) == 0)) {
|
||||
tmpScore = i;// 1 << i;
|
||||
changeRank = qtrue;
|
||||
|
@ -1473,7 +1495,8 @@ static void transTent_think(gentity_t* ent) {
|
|||
for (i = 0; i < level.srvChangeData.count; i++) {
|
||||
if (temp[0] == 0) {
|
||||
Com_sprintf(temp, sizeof(temp), "ui_trdata d%i\\%s\\", i, level.srvChangeData.name[i]);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Com_sprintf(temp, sizeof(temp), "%sd%i\\%s\\", temp, i, level.srvChangeData.name[i]);
|
||||
}
|
||||
}
|
||||
|
@ -1728,7 +1751,8 @@ void G_Client_Begin( int32_t clientNum, qboolean careAboutWarmup, qboolean isBot
|
|||
selfdestruct = G_Find(NULL, FOFS(classname), "target_selfdestruct");
|
||||
if ((selfdestruct != NULL) && ((selfdestruct->spawnflags & 1) != 0)) {
|
||||
trap_SendServerCommand(ent->s.number, va("selfdestructupdate %i", selfdestruct->damage - level.time));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
trap_SendServerCommand(ent->s.number, va("selfdestructupdate %i", -1));
|
||||
}
|
||||
}
|
||||
|
@ -1773,7 +1797,8 @@ static 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;
|
||||
} else if ( g_classData[pclass].isAdmin ) {
|
||||
}
|
||||
else if (g_classData[pclass].isAdmin) {
|
||||
client->ps.stats[STAT_HOLDABLE_ITEM] = BG_FindItemForHoldable(HI_SHIELD) - bg_itemlist;
|
||||
}
|
||||
}
|
||||
|
@ -1845,13 +1870,15 @@ void G_Client_Spawn(gentity_t* ent, int32_t rpgx_spawn, qboolean fromDeath ) {
|
|||
if (rpgx_spawn != 1){//RPG-X: RedTechie - Make sure the spawn is regular spawn or spawn at current position (rpgx_spawn = current possition)
|
||||
if (client->sess.sessionTeam == TEAM_SPECTATOR) {
|
||||
spawnPoint = SelectSpectatorSpawnPoint(spawn_origin, spawn_angles);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
do {
|
||||
// the first spawn should be at a good looking spot
|
||||
if (!client->pers.initialSpawn && client->pers.localClient) {
|
||||
client->pers.initialSpawn = qtrue;
|
||||
spawnPoint = SelectInitialSpawnPoint(spawn_origin, spawn_angles);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// don't spawn near existing origin if possible
|
||||
spawnPoint = G_Client_SelectSpawnPoint(client->ps.origin, spawn_origin, spawn_angles);
|
||||
}
|
||||
|
@ -1962,7 +1989,8 @@ void G_Client_Spawn(gentity_t* ent, int32_t rpgx_spawn, qboolean fromDeath ) {
|
|||
|
||||
if (!fromDeath || (rpg_dropOnDeath.integer == 0) || (rpg_allowWeaponDrop.integer == 0)) {
|
||||
G_Client_WeaponsForClass(client, pClass);
|
||||
} else { // Marcin: just a hand
|
||||
}
|
||||
else { // Marcin: just a hand
|
||||
G_Client_WeaponsForClass(client, 0);
|
||||
}
|
||||
G_Client_HoldablesForClass(client, pClass);
|
||||
|
@ -1985,7 +2013,8 @@ void G_Client_Spawn(gentity_t* ent, int32_t rpgx_spawn, qboolean fromDeath ) {
|
|||
if (rpgx_spawn != 1) {
|
||||
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR) {
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
G_MoveBox(ent);
|
||||
trap_LinkEntity(ent);
|
||||
|
||||
|
@ -2015,7 +2044,8 @@ void G_Client_Spawn(gentity_t* ent, int32_t rpgx_spawn, qboolean fromDeath ) {
|
|||
|
||||
if (level.intermissiontime) {
|
||||
MoveClientToIntermission(ent);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// fire the targets of the spawn point
|
||||
if (rpgx_spawn != 1) {
|
||||
G_UseTargets(spawnPoint, ent);
|
||||
|
@ -2074,7 +2104,8 @@ void G_Client_Spawn(gentity_t* ent, int32_t rpgx_spawn, qboolean fromDeath ) {
|
|||
trap_SendServerCommand(ent - g_entities, va("cp \"%s\"", rpg_welcomemessage.string));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (!clientInitialStatus[ent->s.number].initialized) {
|
||||
//first time coming in
|
||||
switch (g_gametype.integer) {
|
||||
|
@ -2205,7 +2236,8 @@ void G_Client_Disconnect( int32_t clientNum ) {
|
|||
Q_strncpyz(g_reconData[l].ipAddress, ent->client->pers.ip, sizeof(g_reconData[l].ipAddress));
|
||||
//Player Name
|
||||
Q_strncpyz(g_reconData[l].previousName, ent->client->pers.netname, sizeof(g_reconData[l].previousName));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
memset(&g_reconData[g_reconNum], 0, sizeof(g_reconData[g_reconNum]));
|
||||
|
||||
//IP Address
|
||||
|
@ -2305,7 +2337,8 @@ qboolean G_Client_IsAdmin( gentity_t *ent)
|
|||
(ent->client->LoggedAsAdmin == qtrue) ||
|
||||
(ent->client->LoggedAsDeveloper == qtrue)) {
|
||||
return qtrue;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
@ -2371,7 +2404,8 @@ qboolean G_Client_GetLocationMsg(gentity_t *ent, char *loc, int32_t loclen)
|
|||
if (best->count > 7)
|
||||
best->count = 7;
|
||||
Com_sprintf(loc, loclen, "%c%c%s" S_COLOR_WHITE, Q_COLOR_ESCAPE, best->count + '0', best->message);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Com_sprintf(loc, loclen, "%s", best->message);
|
||||
}
|
||||
|
||||
|
@ -2543,7 +2577,8 @@ void G_Client_CheckClientStatus(void) {
|
|||
loc = G_Client_GetLocation(ent);
|
||||
if (loc != NULL) {
|
||||
ent->client->pers.teamState.location = loc->health;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ent->client->pers.teamState.location = 0;
|
||||
}
|
||||
}
|
||||
|
@ -2646,7 +2681,9 @@ static int QDECL SortRanks( const void *a, const void *b ) {
|
|||
}
|
||||
if ((ca->ps.persistant[PERS_SCORE] == cb->ps.persistant[PERS_SCORE]) &&
|
||||
(ca->ps.persistant[PERS_KILLED] < cb->ps.persistant[PERS_KILLED]))
|
||||
{ return -1;}
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ca->ps.persistant[PERS_SCORE]
|
||||
< cb->ps.persistant[PERS_SCORE]) {
|
||||
|
@ -2654,7 +2691,9 @@ static int QDECL SortRanks( const void *a, const void *b ) {
|
|||
}
|
||||
if ((ca->ps.persistant[PERS_SCORE] == cb->ps.persistant[PERS_SCORE]) &&
|
||||
(ca->ps.persistant[PERS_KILLED] > cb->ps.persistant[PERS_KILLED]))
|
||||
{ return 1;}
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2697,7 +2736,8 @@ void G_Client_CalculateRanks( qboolean fromExit ) {
|
|||
}
|
||||
if (level.follow1 == -1) {
|
||||
level.follow1 = i;
|
||||
} else if ( level.follow2 == -1 ) {
|
||||
}
|
||||
else if (level.follow2 == -1) {
|
||||
level.follow2 = i;
|
||||
}
|
||||
}
|
||||
|
@ -2715,13 +2755,16 @@ void G_Client_CalculateRanks( qboolean fromExit ) {
|
|||
cl = &level.clients[level.sortedClients[i]];
|
||||
if (level.teamScores[TEAM_RED] == level.teamScores[TEAM_BLUE]) {
|
||||
cl->ps.persistant[PERS_RANK] = 2;
|
||||
} else if ( level.teamScores[TEAM_RED] > level.teamScores[TEAM_BLUE] ) {
|
||||
}
|
||||
else if (level.teamScores[TEAM_RED] > level.teamScores[TEAM_BLUE]) {
|
||||
cl->ps.persistant[PERS_RANK] = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
cl->ps.persistant[PERS_RANK] = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
int32_t rank = -1;
|
||||
int32_t score = 0;
|
||||
for (i = 0; i < level.numPlayingClients; i++) {
|
||||
|
@ -2733,7 +2776,8 @@ void G_Client_CalculateRanks( qboolean fromExit ) {
|
|||
rank = i;
|
||||
// assume we aren't tied until the next client is checked
|
||||
level.clients[level.sortedClients[i]].ps.persistant[PERS_RANK] = rank;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// we are tied with the previous client
|
||||
level.clients[level.sortedClients[i - 1]].ps.persistant[PERS_RANK] = rank | RANK_TIED_FLAG;
|
||||
level.clients[level.sortedClients[i]].ps.persistant[PERS_RANK] = rank | RANK_TIED_FLAG;
|
||||
|
@ -2749,14 +2793,17 @@ void G_Client_CalculateRanks( qboolean fromExit ) {
|
|||
if (g_gametype.integer >= GT_TEAM) {
|
||||
trap_SetConfigstring(CS_SCORES1, va("%i", level.teamScores[TEAM_RED]));
|
||||
trap_SetConfigstring(CS_SCORES2, va("%i", level.teamScores[TEAM_BLUE]));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (level.numConnectedClients == 0) {
|
||||
trap_SetConfigstring(CS_SCORES1, va("%i", SCORE_NOT_PRESENT));
|
||||
trap_SetConfigstring(CS_SCORES2, va("%i", SCORE_NOT_PRESENT));
|
||||
} else if ( level.numConnectedClients == 1 ) {
|
||||
}
|
||||
else if (level.numConnectedClients == 1) {
|
||||
trap_SetConfigstring(CS_SCORES1, va("%i", level.clients[level.sortedClients[0]].ps.persistant[PERS_SCORE]));
|
||||
trap_SetConfigstring(CS_SCORES2, va("%i", SCORE_NOT_PRESENT));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
trap_SetConfigstring(CS_SCORES1, va("%i", level.clients[level.sortedClients[0]].ps.persistant[PERS_SCORE]));
|
||||
trap_SetConfigstring(CS_SCORES2, va("%i", level.clients[level.sortedClients[1]].ps.persistant[PERS_SCORE]));
|
||||
}
|
||||
|
@ -2795,7 +2842,8 @@ void G_Client_UpdateSoundZones(void) {
|
|||
for (i = 0; i < MAX_CLIENTS; i++) {
|
||||
if (strlen(supdate) != 0) {
|
||||
Com_sprintf(supdate, sizeof(supdate), "%s\\c%d\\%d", supdate, i, zones[i]);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Com_sprintf(supdate, sizeof(supdate), "c%d\\%d", i, zones[i]);
|
||||
}
|
||||
}
|
||||
|
@ -2921,7 +2969,8 @@ void body_die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, int32_
|
|||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (self->health > GIB_HEALTH) {
|
||||
return;
|
||||
}
|
||||
|
@ -3041,10 +3090,12 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
killer = attacker->s.number;
|
||||
if (attacker->client != NULL) {
|
||||
killerName = attacker->client->pers.netname;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
killerName = "<non-client>";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
killer = ENTITYNUM_WORLD;
|
||||
killerName = "<world>";
|
||||
}
|
||||
|
@ -3056,7 +3107,8 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
|
||||
if (meansOfDeath < 0 || meansOfDeath >= sizeof(modNames) / sizeof(modNames[0])) {
|
||||
obit = "<bad obituary>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
obit = modNames[meansOfDeath];
|
||||
}
|
||||
|
||||
|
@ -3082,7 +3134,8 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
ps->persistant[PERS_KILLED]++;
|
||||
if (self == attacker) {
|
||||
self->client->pers.teamState.suicides++;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//RPG-X | Phenix | 06/04/2005
|
||||
// N00b Protection, you kill two people and puff your auto n00b!
|
||||
|
||||
|
@ -3095,13 +3148,15 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
|
||||
if (rpg_kickAfterXkills.integer < 1) {
|
||||
trap_SendServerCommand(attacker - g_entities, va("print \"^7Server: You have been caught n00bing, you have been temporary put in the n00b class.\n\""));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
trap_SendServerCommand(attacker - g_entities, va("print \"^7Server: You have been caught n00bing, %i more times and you will be kicked.\n\"", (rpg_kickAfterXkills.integer - attacker->n00bCount)));
|
||||
}
|
||||
|
||||
if ((attacker->n00bCount >= rpg_kickAfterXkills.integer) && (rpg_kickAfterXkills.integer != 0)) {
|
||||
trap_DropClient(attacker->s.number, "Kicked: Do Not N00b!");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for (i = 0; g_classData[i].consoleName[0] && i < MAX_CLASSES; i++) {
|
||||
if (g_classData[i].isn00b) {
|
||||
char conName[64];
|
||||
|
@ -3160,31 +3215,42 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
//RPG-X : Model system - Death animations now based on vector hit
|
||||
if (meansOfDeath == MOD_FALLING) {
|
||||
anim = BOTH_FALLDEATH1LAND;
|
||||
} else if (self->waterlevel == 3) {
|
||||
}
|
||||
else if (self->waterlevel == 3) {
|
||||
anim = BOTH_FLOAT2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (meansOfDeath == MOD_PHASER || meansOfDeath == MOD_PHASER_ALT) {
|
||||
if ((self->client->lasthurt_location & LOCATION_FRONT) != 0) {
|
||||
anim = BOTH_DEATHBACKWARD1;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
anim = BOTH_DEATHFORWARD2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
anim = BOTH_DEATH2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
anim = BOTH_DEATH2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
anim = BOTH_DEATH1;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ((self->client->lasthurt_location & LOCATION_FRONT) != 0) {
|
||||
anim = BOTH_DEATHBACKWARD2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
anim = BOTH_DEATHFORWARD1;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
anim = BOTH_DEATHFORWARD2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
anim = BOTH_DEATHFORWARD2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
anim = BOTH_DEATH1;
|
||||
}
|
||||
}
|
||||
|
@ -3206,7 +3272,8 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
//---------------------
|
||||
//RPG-X: RedTechie - If it dose equal 0 use regular die
|
||||
//---------------------
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
char* killerName = NULL;
|
||||
char* obit = NULL;
|
||||
char* classname = NULL;
|
||||
|
@ -3265,10 +3332,12 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
killer = attacker->s.number;
|
||||
if (attacker->client != NULL) {
|
||||
killerName = attacker->client->pers.netname;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
killerName = "<non-client>";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
killer = ENTITYNUM_WORLD;
|
||||
killerName = "<world>";
|
||||
}
|
||||
|
@ -3280,7 +3349,8 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
|
||||
if (meansOfDeath < 0 || meansOfDeath >= sizeof(modNames) / sizeof(modNames[0])) {
|
||||
obit = "<bad obituary>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
obit = modNames[meansOfDeath];
|
||||
}
|
||||
|
||||
|
@ -3315,7 +3385,8 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
if (meansOfDeath != MOD_RESPAWN) {//just changing class
|
||||
G_Client_AddScore(attacker, -1);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
attacker->client->pers.teamState.frags++;
|
||||
G_Client_AddScore(attacker, 1);
|
||||
|
||||
|
@ -3324,7 +3395,8 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
|
||||
attacker->client->lastKillTime = level.time;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (meansOfDeath != MOD_RESPAWN) {//not just changing class
|
||||
G_Client_AddScore(self, -1);
|
||||
}
|
||||
|
@ -3392,31 +3464,42 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
//RPG-X : Model system - Death animations now based on vector hit
|
||||
if (meansOfDeath == MOD_FALLING) {
|
||||
anim = BOTH_FALLDEATH1LAND;
|
||||
} else if (self->waterlevel == 3) {
|
||||
}
|
||||
else if (self->waterlevel == 3) {
|
||||
anim = BOTH_FLOAT2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (meansOfDeath == MOD_PHASER || meansOfDeath == MOD_PHASER_ALT) {
|
||||
if ((self->client->lasthurt_location & LOCATION_FRONT) != 0) {
|
||||
anim = BOTH_DEATHBACKWARD1;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
anim = BOTH_DEATHFORWARD2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
anim = BOTH_DEATH2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
anim = BOTH_DEATH2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
anim = BOTH_DEATH1;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ((self->client->lasthurt_location & LOCATION_FRONT) != 0) {
|
||||
anim = BOTH_DEATHBACKWARD2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_BACK) != 0) {
|
||||
anim = BOTH_DEATHFORWARD1;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_LEFT) != 0) {
|
||||
anim = BOTH_DEATHFORWARD2;
|
||||
} else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
}
|
||||
else if ((self->client->lasthurt_location & LOCATION_RIGHT) != 0) {
|
||||
anim = BOTH_DEATHFORWARD2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
anim = BOTH_DEATH1;
|
||||
}
|
||||
}
|
||||
|
@ -3429,7 +3512,8 @@ void G_Client_Die(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, in
|
|||
//G_AddEvent( self, EV_FALL_FAR, killer ); ?? Need to play falling SF now, or
|
||||
// use designer trigger??
|
||||
//FIXME: need *some* kind of death anim!
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// normal death
|
||||
|
||||
switch (meansOfDeath) {
|
||||
|
@ -3505,7 +3589,8 @@ qboolean G_Client_IsBorg(gentity_t* ent) {
|
|||
|
||||
if (g_classData[ent->client->sess.sessionClass].isBorg) {
|
||||
return qtrue;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue