diff options
author | Jeija <norrepli@gmail.com> | 2013-01-27 10:33:25 +0100 |
---|---|---|
committer | PilzAdam <PilzAdam@gmx.de> | 2013-02-19 20:02:40 +0100 |
commit | 365c169b43f61b7f957bdd302b3cf9a837cabec1 (patch) | |
tree | 05117c9c24e525868c03d81e0d44a513b47d1548 /src/scriptapi.cpp | |
parent | 214a8b4597728213065f1bf880f4357b723b5bea (diff) | |
download | minetest-365c169b43f61b7f957bdd302b3cf9a837cabec1.tar.xz |
Disable placement prediction for nodes that use on_rightclick
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r-- | src/scriptapi.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 020709cab..66654813e 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -1063,6 +1063,10 @@ static ItemDefinition read_item_definition(lua_State *L, int index, def.usable = lua_isfunction(L, -1); lua_pop(L, 1); + lua_getfield(L, index, "on_rightclick"); + def.rightclickable = lua_isfunction(L, -1); + lua_pop(L, 1); + getboolfield(L, index, "liquids_pointable", def.liquids_pointable); warn_if_field_exists(L, index, "tool_digging_properties", @@ -4746,7 +4750,7 @@ static int l_register_item_raw(lua_State *L) // Default to having client-side placement prediction for nodes // ("" in item definition sets it off) if(def.node_placement_prediction == "__default"){ - if(def.type == ITEM_NODE) + if(def.type == ITEM_NODE && !def.rightclickable) def.node_placement_prediction = name; else def.node_placement_prediction = ""; |