aboutsummaryrefslogtreecommitdiff
path: root/src/scriptapi.cpp
diff options
context:
space:
mode:
authorWeblate <42@minetest.ru>2013-02-28 18:03:28 +0100
committerWeblate <42@minetest.ru>2013-02-28 18:03:28 +0100
commit22e186b4aa88b585e71500c4e9a03bf69b0b6191 (patch)
tree14c5b7a73cf144ba7cf3066caac088a200f81a72 /src/scriptapi.cpp
parent372acf7b8eca0614a4a0da93cfbaccbcd459b36b (diff)
parentd31f07bd4b83f858cce589faac56922e12ba670f (diff)
downloadminetest-22e186b4aa88b585e71500c4e9a03bf69b0b6191.tar.gz
minetest-22e186b4aa88b585e71500c4e9a03bf69b0b6191.tar.bz2
minetest-22e186b4aa88b585e71500c4e9a03bf69b0b6191.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r--src/scriptapi.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index 020709cab..7fddcfc68 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -1,6 +1,6 @@
/*
-Minetest-c55
-Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -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",
@@ -4250,6 +4254,7 @@ private:
tree_def.fruitnode=ndef->getId(fruit);
getintfield(L, 3, "fruit_chance",tree_def.fruit_chance);
}
+ getintfield(L, 3, "seed", tree_def.seed);
}
else
return 0;
@@ -4746,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)
+ if(def.type == ITEM_NODE && !def.rightclickable)
def.node_placement_prediction = name;
else
def.node_placement_prediction = "";