MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / PlayObjectExplosionSound

Function PlayObjectExplosionSound

Descent3/fireball.cpp:1307–1323  ·  view source on GitHub ↗

Play the explosion sound for this object

Source from the content-addressed store, hash-verified

1305}
1306// Play the explosion sound for this object
1307void PlayObjectExplosionSound(object *objp) {
1308 int sound;
1309 if (objp->type == OBJ_DOOR) {
1310 sound = SOUND_ROBOT_EXPLODE_1;
1311 } else {
1312 ASSERT(IS_GENERIC(objp->type));
1313 sound = Object_info[objp->id].sounds[GSI_EXPLODE];
1314 if (sound == SOUND_NONE_INDEX) { // check for default
1315 if (objp->type == OBJ_BUILDING)
1316 sound = SOUND_BUILDING_EXPLODE;
1317 else
1318 sound = (ps_rand() > D3_RAND_MAX / 2) ? SOUND_ROBOT_EXPLODE_1 : SOUND_ROBOT_EXPLODE_2;
1319 }
1320 }
1321 if (sound != -1)
1322 Sound_system.Play3dSound(sound, SND_PRIORITY_HIGH, objp);
1323}
1324const char *dead_object_types[] = {
1325 "swatter", "swatter(deadmodel)", "Hangturret", "Securityturret(DEAD)",
1326 "Lance", "Lance(DEAD)", "L10 swatter", "swatter(deadmodel)",

Callers 2

DestroyObjectFunction · 0.85
KillObjectFunction · 0.85

Calls 2

ps_randFunction · 0.85
Play3dSoundMethod · 0.80

Tested by

no test coverage detected