diff options
author | PilzAdam <pilzadam@minetest.net> | 2013-07-09 02:38:53 +0200 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-07-09 02:42:05 +0200 |
commit | c8bd2ae11cb0972eda86577ab15c2c69ecae33d0 (patch) | |
tree | 077b035c9b5cc1441508dd3f67753aab9db12320 /src/game.cpp | |
parent | e1a13608d85818cae8543e72f78659dcdfa99fc1 (diff) | |
download | minetest-c8bd2ae11cb0972eda86577ab15c2c69ecae33d0.tar.gz minetest-c8bd2ae11cb0972eda86577ab15c2c69ecae33d0.tar.bz2 minetest-c8bd2ae11cb0972eda86577ab15c2c69ecae33d0.zip |
Dont play digging sound if not digging
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/game.cpp b/src/game.cpp index 0ae323208..ff694d12e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2612,20 +2612,6 @@ void the_game( if(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; @@ -2658,6 +2644,20 @@ void the_game( 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 if(dig_time_complete >= 100000.0) { |