mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Disable placement prediction for nodes that use on_rightclick
This commit is contained in:
parent
214a8b4597
commit
365c169b43
6 changed files with 15 additions and 2 deletions
|
@ -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 = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue