aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <ShadowNinja@users.noreply.github.com>2017-06-03 17:59:17 -0400
committerSmallJoker <mk939@ymail.com>2018-06-03 17:31:59 +0200
commitcba783f7faf517cb747177b2854567de5604c65d (patch)
tree4ed916dfbdf4cd875865c793e0c01fd4df320f65
parent87b94518207381da10344d9fe08269687da36de5 (diff)
downloadminetest-cba783f7faf517cb747177b2854567de5604c65d.tar.gz
minetest-cba783f7faf517cb747177b2854567de5604c65d.tar.bz2
minetest-cba783f7faf517cb747177b2854567de5604c65d.zip
Fix segmentation fault with tool capabilities (#5899)
-rw-r--r--src/game.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index ff473e022..75d1f7cc8 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);