Fix L-System trees fruit node regression (#15513)

This commit is contained in:
cx384 2024-12-06 18:06:27 +01:00 committed by GitHub
parent 05d31222f7
commit 88c845166c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

@ -23,8 +23,7 @@ void TreeDef::resolveNodeNames()
getIdFromNrBacklog(&leavesnode.param0, "", CONTENT_IGNORE);
if (leaves2_chance)
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);
getboolfield(L, idx, "thin_branches", tree_def.thin_branches);
tree_def.fruit_chance = 0;
fruit = "air";
getstringfield(L, idx, "fruit", fruit);
if (!fruit.empty()) {
if (!fruit.empty())
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);
// Resolves the node IDs for trunk, leaves, leaves2 and fruit at runtime,