mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Fix L-System trees fruit node regression (#15513)
This commit is contained in:
parent
05d31222f7
commit
88c845166c
2 changed files with 4 additions and 6 deletions
|
@ -23,7 +23,6 @@ void TreeDef::resolveNodeNames()
|
||||||
getIdFromNrBacklog(&leavesnode.param0, "", CONTENT_IGNORE);
|
getIdFromNrBacklog(&leavesnode.param0, "", CONTENT_IGNORE);
|
||||||
if (leaves2_chance)
|
if (leaves2_chance)
|
||||||
getIdFromNrBacklog(&leaves2node.param0, "", CONTENT_IGNORE);
|
getIdFromNrBacklog(&leaves2node.param0, "", CONTENT_IGNORE);
|
||||||
if (fruit_chance)
|
|
||||||
getIdFromNrBacklog(&fruitnode.param0, "", CONTENT_IGNORE);
|
getIdFromNrBacklog(&fruitnode.param0, "", CONTENT_IGNORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2032,12 +2032,11 @@ bool read_tree_def(lua_State *L, int idx, const NodeDefManager *ndef,
|
||||||
getstringfield(L, idx, "trunk_type", tree_def.trunk_type);
|
getstringfield(L, idx, "trunk_type", tree_def.trunk_type);
|
||||||
getboolfield(L, idx, "thin_branches", tree_def.thin_branches);
|
getboolfield(L, idx, "thin_branches", tree_def.thin_branches);
|
||||||
tree_def.fruit_chance = 0;
|
tree_def.fruit_chance = 0;
|
||||||
|
fruit = "air";
|
||||||
getstringfield(L, idx, "fruit", fruit);
|
getstringfield(L, idx, "fruit", fruit);
|
||||||
if (!fruit.empty()) {
|
if (!fruit.empty())
|
||||||
getintfield(L, idx, "fruit_chance", tree_def.fruit_chance);
|
getintfield(L, idx, "fruit_chance", tree_def.fruit_chance);
|
||||||
if (tree_def.fruit_chance)
|
|
||||||
tree_def.m_nodenames.push_back(fruit);
|
tree_def.m_nodenames.push_back(fruit);
|
||||||
}
|
|
||||||
tree_def.explicit_seed = getintfield(L, idx, "seed", tree_def.seed);
|
tree_def.explicit_seed = getintfield(L, idx, "seed", tree_def.seed);
|
||||||
|
|
||||||
// Resolves the node IDs for trunk, leaves, leaves2 and fruit at runtime,
|
// Resolves the node IDs for trunk, leaves, leaves2 and fruit at runtime,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue