Dont dig or place nodes if interact priv is missing (clientside)
authorPilzAdam <pilzadam@minetest.net>
Wed, 19 Jun 2013 21:00:14 +0000 (21:00 +0000)
committerPilzAdam <pilzadam@minetest.net>
Wed, 19 Jun 2013 21:42:12 +0000 (21:42 +0000)
src/game.cpp

index 88be47b396ae80db3c0d67b0264a9a5ecfb3c1c1..f00e4c949059a036a18d0559a40c510d4c39709c 100644 (file)
@@ -2589,7 +2589,8 @@ void the_game(
                                Handle digging
                        */
                        
-                       if(nodig_delay_timer <= 0.0 && input->getLeftState())
+                       if(nodig_delay_timer <= 0.0 && input->getLeftState()
+                                       && client.checkPrivilege("interact"))
                        {
                                if(!digging)
                                {
@@ -2716,8 +2717,10 @@ void the_game(
                                camera.setDigging(0);  // left click animation
                        }
 
-                       if(input->getRightClicked() ||
-                                       repeat_rightclick_timer >= g_settings->getFloat("repeat_rightclick_time"))
+                       if((input->getRightClicked() ||
+                                       repeat_rightclick_timer >=
+                                               g_settings->getFloat("repeat_rightclick_time")) &&
+                                       client.checkPrivilege("interact"))
                        {
                                repeat_rightclick_timer = 0;
                                infostream<<"Ground right-clicked"<<std::endl;