summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShadowNinja <ShadowNinja@users.noreply.github.com>2017-06-03 17:59:17 -0400
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-06-03 23:59:17 +0200
commit7786521f151b6006656768fdd308f1d7e1635645 (patch)
treec1b4e889000d4bb25f5ccfb7a033440387a3a717 /src
parentdd0a058e1fc74f37605022b52fa1f6b04086bbbf (diff)
downloadminetest-7786521f151b6006656768fdd308f1d7e1635645.tar.gz
minetest-7786521f151b6006656768fdd308f1d7e1635645.tar.bz2
minetest-7786521f151b6006656768fdd308f1d7e1635645.zip
Fix segmentation fault with tool capabilities (#5899)
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 765744b75..aeb9e8f45 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3597,7 +3597,7 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud, bool show_debug)
} else if (pointed.type == POINTEDTHING_NODE) {
ToolCapabilities playeritem_toolcap =
playeritem.getToolCapabilities(itemdef_manager);
- if (playeritem.name.empty()) {
+ if (playeritem.name.empty() && hand_def.tool_capabilities != NULL) {
playeritem_toolcap = *hand_def.tool_capabilities;
}
handlePointingAtNode(pointed, playeritem_def, playeritem_toolcap, dtime);