Reset dig_time when switching to a tool that cant dig the current node
authorPilzAdam <pilzadam@minetest.net>
Thu, 13 Jun 2013 12:41:23 +0000 (12:41 +0000)
committerPilzAdam <pilzadam@minetest.net>
Thu, 13 Jun 2013 13:34:48 +0000 (13:34 +0000)
src/game.cpp

index cbb0d91835455bf918255c7d72d95ad80584b20f..30d9c7fafe9b9ceb7cab6c191f0b6a55bf721ebf 100644 (file)
@@ -2706,7 +2706,12 @@ void the_game(
                                        gamedef->event()->put(e);
                                }
 
-                               dig_time += dtime;
+                               if(dig_time_complete < 100000.0)
+                                       dig_time += dtime;
+                               else {
+                                       dig_time = 0;
+                                       client.setCrack(-1, nodepos);
+                               }
 
                                camera.setDigging(0);  // left click animation
                        }