1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-24 00:18:53 -05:00

Dont play digging sound if not digging

This commit is contained in:
PilzAdam 2013-07-09 02:38:53 +02:00
parent e1a13608d8
commit c8bd2ae11c

View File

@ -2613,20 +2613,6 @@ void the_game(
params = getDigParams(nodedef->get(n).groups, tp); params = getDigParams(nodedef->get(n).groups, tp);
} }
SimpleSoundSpec sound_dig = nodedef->get(n).sound_dig;
if(sound_dig.exists()){
if(sound_dig.name == "__group"){
if(params.main_group != ""){
soundmaker.m_player_leftpunch_sound.gain = 0.5;
soundmaker.m_player_leftpunch_sound.name =
std::string("default_dig_") +
params.main_group;
}
} else{
soundmaker.m_player_leftpunch_sound = sound_dig;
}
}
float dig_time_complete = 0.0; float dig_time_complete = 0.0;
if(params.diggable == false) if(params.diggable == false)
@ -2658,6 +2644,20 @@ void the_game(
dig_index = crack_animation_length; dig_index = crack_animation_length;
} }
SimpleSoundSpec sound_dig = nodedef->get(n).sound_dig;
if(sound_dig.exists() && params.diggable){
if(sound_dig.name == "__group"){
if(params.main_group != ""){
soundmaker.m_player_leftpunch_sound.gain = 0.5;
soundmaker.m_player_leftpunch_sound.name =
std::string("default_dig_") +
params.main_group;
}
} else{
soundmaker.m_player_leftpunch_sound = sound_dig;
}
}
// Don't show cracks if not diggable // Don't show cracks if not diggable
if(dig_time_complete >= 100000.0) if(dig_time_complete >= 100000.0)
{ {