Fix nodeplacement prediction
authorPilzAdam <PilzAdam@gmx.de>
Wed, 27 Feb 2013 19:23:32 +0000 (20:23 +0100)
committerPilzAdam <PilzAdam@gmx.de>
Wed, 27 Feb 2013 19:23:32 +0000 (20:23 +0100)
src/itemdef.cpp
src/itemdef.h
src/scriptapi.cpp

index c1ecf762f17d5711387a22f83062b89fdce41e13..5fd27fca382933a8cdfbd39cc7ae8b1b0283a479 100644 (file)
@@ -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)
        {
index 4a9e16966f668e20fdb7b85adb705e95ea833b58..dd20ba353a403476de70da40d7431af6ab80ff1d 100644 (file)
@@ -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;
index 7fddcfc68a61dba5cb38dbffc7c3e51812295d7f..7aa148fd637883c8354ee762db50cfbc468fa25d 100644 (file)
@@ -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 = "";