summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_buildable.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 446311f..ed243cc 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -503,6 +503,13 @@ static void nullDieFunction( gentity_t *self, gentity_t *inflictor, gentity_t *a
{
}
+static void G_BuildableDeathSound( gentity_t *self )
+{
+ gentity_t *snd = G_TempEntity( self->r.currentOrigin, EV_GENERAL_SOUND );
+ snd->s.eventParm = G_SoundIndex( BG_FindTeamForBuildable( self->s.modelindex ) == PTE_HUMANS ?
+ "sound/buildables/human/destroyed" : "sound/buildables/alien/construct2" );
+}
+
/*
================
freeBuildable
@@ -696,6 +703,8 @@ void ASpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
new->next = NULL;
G_LogBuild( new );
+ G_BuildableDeathSound( self );
+
G_SetBuildableAnim( self, BANIM_DESTROY1, qtrue );
G_SetIdleBuildableAnim( self, BANIM_DESTROYED );
@@ -1020,6 +1029,8 @@ void ABarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker,
new->next = NULL;
G_LogBuild( new );
+ G_BuildableDeathSound( self );
+
G_SetBuildableAnim( self, BANIM_DESTROY1, qtrue );
G_SetIdleBuildableAnim( self, BANIM_DESTROYED );
@@ -1478,6 +1489,8 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
new->next = NULL;
G_LogBuild( new );
+ G_BuildableDeathSound( self );
+
VectorCopy( self->s.origin2, dir );
//do a bit of radius damage
@@ -2641,6 +2654,8 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
new->next = NULL;
G_LogBuild( new );
+ G_BuildableDeathSound( self );
+
//pretty events and cleanup
G_SetBuildableAnim( self, BANIM_DESTROY1, qtrue );
G_SetIdleBuildableAnim( self, BANIM_DESTROYED );