mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Allow multiple 'wherein' nodes in oredef
This commit is contained in:
@@ -91,18 +91,17 @@ void Ore::resolveNodeNames(INodeDefManager *ndef) {
|
||||
if (ore == CONTENT_IGNORE) {
|
||||
errorstream << "Ore::resolveNodeNames: ore node '"
|
||||
<< ore_name << "' not defined";
|
||||
ore = CONTENT_AIR;
|
||||
wherein = CONTENT_AIR;
|
||||
ore = CONTENT_AIR;
|
||||
wherein.push_back(CONTENT_AIR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (wherein == CONTENT_IGNORE) {
|
||||
wherein = ndef->getId(wherein_name);
|
||||
if (wherein == CONTENT_IGNORE) {
|
||||
errorstream << "Ore::resolveNodeNames: wherein node '"
|
||||
<< wherein_name << "' not defined";
|
||||
ore = CONTENT_AIR;
|
||||
wherein = CONTENT_AIR;
|
||||
for (size_t i=0; i != wherein_names.size(); i++) {
|
||||
std::string name = wherein_names[i];
|
||||
content_t c = ndef->getId(name);
|
||||
if (c != CONTENT_IGNORE) {
|
||||
wherein.push_back(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,8 +160,9 @@ void OreScatter::generate(ManualMapVoxelManipulator *vm, int seed,
|
||||
continue;
|
||||
|
||||
u32 i = vm->m_area.index(x0 + x1, y0 + y1, z0 + z1);
|
||||
if (vm->m_data[i].getContent() == wherein)
|
||||
vm->m_data[i] = n_ore;
|
||||
for (size_t ii = 0; ii < wherein.size(); ii++)
|
||||
if (vm->m_data[i].getContent() == wherein[ii])
|
||||
vm->m_data[i] = n_ore;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,8 +199,9 @@ void OreSheet::generate(ManualMapVoxelManipulator *vm, int seed,
|
||||
if (!vm->m_area.contains(i))
|
||||
continue;
|
||||
|
||||
if (vm->m_data[i].getContent() == wherein)
|
||||
vm->m_data[i] = n_ore;
|
||||
for (size_t ii = 0; ii < wherein.size(); ii++)
|
||||
if (vm->m_data[i].getContent() == wherein[ii])
|
||||
vm->m_data[i] = n_ore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user