summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 66c8859c8..612bd2536 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3895,17 +3895,20 @@ void Game::handleDigging(GameRunData *runData,
const PointedThing &pointed, const v3s16 &nodepos,
const ToolCapabilities &playeritem_toolcap, f32 dtime)
{
+
+ LocalPlayer *player = client->getEnv().getLocalPlayer();
+ ClientMap &map = client->getEnv().getClientMap();
+ MapNode n = client->getEnv().getClientMap().getNodeNoEx(nodepos);
+
if (!runData->digging) {
infostream << "Started digging" << std::endl;
+ if (client->getScript()->on_punchnode(nodepos, n))
+ return;
client->interact(0, pointed);
runData->digging = true;
runData->ldown_for_dig = true;
}
- LocalPlayer *player = client->getEnv().getLocalPlayer();
- ClientMap &map = client->getEnv().getClientMap();
- MapNode n = client->getEnv().getClientMap().getNodeNoEx(nodepos);
-
// NOTE: Similar piece of code exists on the server side for
// cheat detection.
// Get digging parameters