From d4a7e30ff0a17515899825c2a99f31cfbba2cf0a Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Sun, 7 Apr 2002 03:22:48 +0000 Subject: [PATCH] Tweaks and crashbug fixes --- reaction/game/g_client.c | 16 ++++++++++++---- reaction/game/g_cmds.c | 6 +++++- reaction/game/g_combat.c | 7 +++++-- reaction/game/g_teamplay.c | 8 +++++++- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index 519d9423..5fb4cc32 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.62 2002/04/07 03:22:48 jbravo +// Tweaks and crashbug fixes +// // Revision 1.61 2002/04/05 18:53:26 jbravo // Warning fixes // @@ -1231,8 +1234,8 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) { client->specMode = SPECTATOR_FREE; client->ps.pm_flags &= ~PMF_FOLLOW; client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM; + camera_begin(ent); client->camera->mode = CAMERA_MODE_SWING; - RQ3_SpectatorMode(ent); } //Blaze: Send out the breakable names to the clients @@ -1347,8 +1350,13 @@ void ClientBegin(int clientNum) { // JBravo: default weapons if (g_gametype.integer == GT_TEAMPLAY) { // NiceAss: Only set it if there is no value. Fix for going into spectator resetting values. - if (!client->teamplayWeapon) client->teamplayWeapon = WP_MP5; - if (!client->teamplayItem) client->teamplayItem = HI_KEVLAR; + if (ent->r.svFlags & SVF_BOT) { + if (!client->teamplayWeapon) client->teamplayWeapon = WP_PISTOL; + if (!client->teamplayItem) client->teamplayItem = HI_KEVLAR; + } else { + if (!client->teamplayWeapon) client->teamplayWeapon = WP_MP5; + if (!client->teamplayItem) client->teamplayItem = HI_KEVLAR; + } i = RQ3TeamCount( -1, client->sess.sessionTeam); } } @@ -1688,7 +1696,7 @@ void ClientSpawn(gentity_t *ent) { //Blaze: Send cheat cvars to client if (!G_SendCheatVars(ent->s.clientNum)) { - Com_Printf("Error loading cvar cfg"); + Com_Printf("Error loading cvar cfg\n"); //return "Error_loading_cvar_cfg"; } diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 775727e3..2f7fea93 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.90 2002/04/07 03:22:48 jbravo +// Tweaks and crashbug fixes +// // Revision 1.89 2002/04/05 18:53:26 jbravo // Warning fixes // @@ -1514,7 +1517,8 @@ static void Cmd_VoiceTaunt_f( gentity_t *ent ) { // insult someone you just killed // if (ent->client->lastkilled_client >= 0 && ent->client->lastkilled_client != ent->s.number) { // JBravo: adding the multiple killed system. - if (ent->client->lastkilled_client[0]->s.number >= 0 && ent->client->lastkilled_client[0]->s.number != ent->s.number) { + if (ent->client->lastkilled_client[0] != NULL && ent->client->lastkilled_client[0]->s.number >= 0 && + ent->client->lastkilled_client[0]->s.number != ent->s.number) { // who = g_entities + ent->client->lastkilled_client; who = ent->client->lastkilled_client[0]; if (who->client) { diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index 6ee2b20c..67370768 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.59 2002/04/07 03:22:48 jbravo +// Tweaks and crashbug fixes +// // Revision 1.58 2002/04/06 20:47:24 niceass // fall damage bug fix // @@ -1890,9 +1893,9 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, // do the damage if (take) { - // G_Printf("(%d) taken as damage\n",take); // JBravo: for Damage delt tracking - if (attacker && attacker->client) attacker->client->ps.persistant[PERS_DAMAGE_DELT] += take; + if (attacker && attacker->client && targ->health > 0) + attacker->client->ps.persistant[PERS_DAMAGE_DELT] += take; if (instant_dam) { // G_Printf("(%d) instant damage\n",take); targ->health = targ->health - take; diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index 6d38eb03..310b0a4c 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.60 2002/04/07 03:22:48 jbravo +// Tweaks and crashbug fixes +// // Revision 1.59 2002/04/06 21:42:20 makro // Changes to bot code. New surfaceparm system. // @@ -679,7 +682,7 @@ void SpawnPlayers() for (i=0;iclassname,"func_breakable")) + if (ent->classname != NULL && !strcmp(ent->classname, "func_breakable")) { //re-link all unlinked breakables trap_LinkEntity(ent); @@ -1455,6 +1458,9 @@ void ParseSayText (gentity_t *ent, char *text) void RQ3_SpectatorMode(gentity_t *ent) { + if (ent->r.svFlags & SVF_BOT) + return; + if (ent->client->sess.spectatorState == SPECTATOR_ZCAM) trap_SendServerCommand(ent->client->ps.clientNum, va("print \"\n" S_COLOR_MAGENTA "Spectator Mode-" S_COLOR_YELLOW"ZCAM-%s\n",