mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add test ore (coal)
This commit is contained in:
parent
36eed38b4c
commit
d534207deb
9 changed files with 31 additions and 10 deletions
|
|
@ -79,6 +79,7 @@ public:
|
|||
}
|
||||
|
||||
std::vector<StructurePlacement> placeStructures(
|
||||
const GeneratorDef& def,
|
||||
const glm::ivec2& offset, const glm::ivec2& size, uint64_t seed,
|
||||
const std::shared_ptr<Heightmap>& heightmap
|
||||
) override {
|
||||
|
|
@ -98,7 +99,15 @@ public:
|
|||
lua::rawgeti(L, i);
|
||||
|
||||
lua::rawgeti(L, 1);
|
||||
int structIndex = lua::tointeger(L, -1);
|
||||
int structIndex = 0;
|
||||
if (lua::isstring(L, -1)) {
|
||||
const auto& found = def.structuresIndices.find(lua::require_string(L, -1));
|
||||
if (found != def.structuresIndices.end()) {
|
||||
structIndex = found->second;
|
||||
}
|
||||
} else {
|
||||
structIndex = lua::tointeger(L, -1);
|
||||
}
|
||||
lua::pop(L);
|
||||
|
||||
lua::rawgeti(L, 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue