From 0244441adde816d896eb05034b48202bc19e19dd Mon Sep 17 00:00:00 2001
From: Ben Millwood <thebenmachine@gmail.com>
Date: Sat, 3 Oct 2009 12:17:37 +0000
Subject: * Don't play EV_FALL_FAR sound if dead * Merging some fixes from
 mgdev, courtesy of Michael "Risujin" Levin:   - Ensure SnapVector always
 snaps downwards, rather than always towards 0   - Don't send score
 information that won't be displayed   - /give poison as a human poisons
 rather than boosting * Remove some trailing whitespace * Remove some useless
 intermediate variables in cg_draw.c * Ammo/clips/build timer display depends
 on primary weapon rather than equipped   - (this also fixes bug 3837)

---
 src/game/bg_lib.c   |  2 +-
 src/game/bg_pmove.c |  6 +++---
 src/game/g_cmds.c   | 28 ++++++++++++++--------------
 3 files changed, 18 insertions(+), 18 deletions(-)

(limited to 'src/game')

diff --git a/src/game/bg_lib.c b/src/game/bg_lib.c
index 328af322..fa184228 100644
--- a/src/game/bg_lib.c
+++ b/src/game/bg_lib.c
@@ -76,7 +76,7 @@ static char* med3(char *, char *, char *, cmp_t *);
 static void  swapfunc(char *, char *, int, int);
 
 #ifndef min
-#define min(a, b) ((a) < (b) ? a : b)
+#define min(a, b) ((a) < (b) ? (a) : (b))
 #endif
 
 /*
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 7f62fd14..6769fa02 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -1757,12 +1757,12 @@ static void PM_CrashLand( void )
 
     if( delta > AVG_FALL_DISTANCE )
     {
-      PM_AddEvent( EV_FALL_FAR );
+      if( PM_Live( pm->ps->pm_type ) )
+        PM_AddEvent( EV_FALL_FAR );
     }
     else if( delta > MIN_FALL_DISTANCE )
     {
-      // this is a pain grunt, so don't play it if dead
-      if( pm->ps->stats[STAT_HEALTH] > 0 )
+      if( PM_Live( pm->ps->pm_type ) )
         PM_AddEvent( EV_FALL_MEDIUM );
     }
     else
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index e9052b05..00302fc1 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -585,7 +585,7 @@ void Cmd_Team_f( gentity_t *ent )
       {
         trap_SendServerCommand( ent-g_entities,
           "print \"Alien team has been ^1LOCKED\n\"" );
-        return; 
+        return;
       }
       else if( level.humanTeamLocked )
         force = qtrue;
@@ -604,7 +604,7 @@ void Cmd_Team_f( gentity_t *ent )
       {
         trap_SendServerCommand( ent-g_entities,
           "print \"Human team has been ^1LOCKED\n\"" );
-        return; 
+        return;
       }
       else if( level.alienTeamLocked )
         force = qtrue;
@@ -790,7 +790,7 @@ static void Cmd_Say_f( gentity_t *ent )
 
   // support parsing /a out of say text for the same reason
   if( !Q_stricmpn( args, "say /a ", 7 ) ||
-      !Q_stricmpn( args, "say_team /a ", 12 ) ) 
+      !Q_stricmpn( args, "say_team /a ", 12 ) )
   {
     Cmd_AdminMessage_f( ent );
     return;
@@ -864,7 +864,7 @@ void Cmd_VSay_f( gentity_t *ent )
   trap_Argv( 0, arg, sizeof( arg ) );
   if( trap_Argc( ) < 2 )
   {
-    trap_SendServerCommand( ent-g_entities, va( 
+    trap_SendServerCommand( ent-g_entities, va(
       "print \"usage: %s command [text] \n\"", arg ) );
     return;
   }
@@ -876,7 +876,7 @@ void Cmd_VSay_f( gentity_t *ent )
   }
   if( !g_voiceChats.integer )
   {
-    trap_SendServerCommand( ent-g_entities, va( 
+    trap_SendServerCommand( ent-g_entities, va(
       "print \"%s: voice system administratively disabled on this server\n\"",
       arg ) );
     return;
@@ -890,22 +890,22 @@ void Cmd_VSay_f( gentity_t *ent )
   else
     return;
   Q_strncpyz( vsay, arg, sizeof( vsay ) );
- 
+
   if( ent->client->pers.voice[ 0 ] )
     Q_strncpyz( voiceName, ent->client->pers.voice, sizeof( voiceName ) );
   voice = BG_VoiceByName( level.voices, voiceName );
   if( !voice )
   {
-    trap_SendServerCommand( ent-g_entities, va( 
+    trap_SendServerCommand( ent-g_entities, va(
       "print \"%s: voice '%s' not found\n\"", vsay, voiceName ) );
     return;
   }
-  
+
   trap_Argv( 1, voiceCmd, sizeof( voiceCmd ) ) ;
   cmd = BG_VoiceCmdFind( voice->cmds, voiceCmd, &cmdNum );
   if( !cmd )
   {
-    trap_SendServerCommand( ent-g_entities, va( 
+    trap_SendServerCommand( ent-g_entities, va(
      "print \"%s: command '%s' not found in voice '%s'\n\"",
       vsay, voiceCmd, voiceName ) );
     return;
@@ -923,20 +923,20 @@ void Cmd_VSay_f( gentity_t *ent )
     &trackNum );
   if( !track )
   {
-    trap_SendServerCommand( ent-g_entities, va( 
+    trap_SendServerCommand( ent-g_entities, va(
       "print \"%s: no available track for command '%s', team %d, "
       "class %d, weapon %d, and enthusiasm %d in voice '%s'\n\"",
       vsay, voiceCmd, ent->client->pers.teamSelection,
       ent->client->pers.classSelection, weapon,
       (int)ent->client->voiceEnthusiasm, voiceName ) );
-    return; 
+    return;
   }
 
   if( !Q_stricmp( ent->client->lastVoiceCmd, cmd->cmd ) )
     ent->client->voiceEnthusiasm++;
 
   Q_strncpyz( ent->client->lastVoiceCmd, cmd->cmd,
-    sizeof( ent->client->lastVoiceCmd ) ); 
+    sizeof( ent->client->lastVoiceCmd ) );
 
   // optional user supplied text
   trap_Argv( 2, arg, sizeof( arg ) );
@@ -956,7 +956,7 @@ void Cmd_VSay_f( gentity_t *ent )
       break;
     default:
       break;
-  } 
+  }
 }
 
 /*
@@ -3371,7 +3371,7 @@ void Cmd_AdminMessage_f( gentity_t *ent )
                  ent->client->pers.netname );
   }
 
-  // Skip say/say_team if this was used from one of those 
+  // Skip say/say_team if this was used from one of those
   G_SayArgv( 0, cmd, sizeof( cmd ) );
   if( !Q_stricmp( cmd, "say" ) || !Q_stricmp( cmd, "say_team" ) )
   {
-- 
cgit