summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPilzAdam <PilzAdam@gmx.de>2013-02-27 20:23:32 +0100
committerPilzAdam <PilzAdam@gmx.de>2013-02-27 20:23:32 +0100
commit0183bdad0482d60dccfdcf68f84db629c05a7018 (patch)
treed896ec1049f04657c5952ae15521733e9c7a9984 /src
parentd31f07bd4b83f858cce589faac56922e12ba670f (diff)
downloadminetest-0183bdad0482d60dccfdcf68f84db629c05a7018.tar.gz
minetest-0183bdad0482d60dccfdcf68f84db629c05a7018.tar.bz2
minetest-0183bdad0482d60dccfdcf68f84db629c05a7018.zip
Fix nodeplacement prediction
Diffstat (limited to 'src')
-rw-r--r--src/itemdef.cpp1
-rw-r--r--src/itemdef.h2
-rw-r--r--src/scriptapi.cpp10
3 files changed, 5 insertions, 8 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index c1ecf762f..5fd27fca3 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -100,7 +100,6 @@ void ItemDefinition::reset()
wield_scale = v3f(1.0, 1.0, 1.0);
stack_max = 99;
usable = false;
- rightclickable = false;
liquids_pointable = false;
if(tool_capabilities)
{
diff --git a/src/itemdef.h b/src/itemdef.h
index 4a9e16966..dd20ba353 100644
--- a/src/itemdef.h
+++ b/src/itemdef.h
@@ -62,8 +62,6 @@ struct ItemDefinition
*/
s16 stack_max;
bool usable;
- // If true, don't use node placement prediction
- bool rightclickable;
bool liquids_pointable;
// May be NULL. If non-NULL, deleted by destructor
ToolCapabilities *tool_capabilities;
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index 7fddcfc68..7aa148fd6 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -1063,10 +1063,6 @@ 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",
@@ -1164,6 +1160,10 @@ static ContentFeatures read_content_features(lua_State *L, int index)
if(!lua_isnil(L, -1)) f.has_after_destruct = true;
lua_pop(L, 1);
+ lua_getfield(L, index, "on_rightclick");
+ f.rightclickable = lua_isfunction(L, -1);
+ lua_pop(L, 1);
+
/* Name */
getstringfield(L, index, "name", f.name);
@@ -4751,7 +4751,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 && !def.rightclickable)
+ if(def.type == ITEM_NODE)
def.node_placement_prediction = name;
else
def.node_placement_prediction = "";