Fix compile when the props module isn't present.

This commit is contained in:
Relintai 2020-06-27 18:25:51 +02:00
parent 97f10512f8
commit c10d7b7b8c
3 changed files with 8 additions and 0 deletions

4
SCsub
View File

@ -13,6 +13,10 @@ if os.path.isdir('../voxelman'):
if os.path.isdir('../fastnoise'):
module_env.Append(CPPDEFINES=['FASTNOISE_PRESENT'])
if os.path.isdir('../props'):
module_env.Append(CPPDEFINES=['PROPS_PRESENT'])
sources = [
"register_types.cpp",

View File

@ -169,6 +169,7 @@ void Biome::_setup_library(Ref<VoxelmanLibrary> library) {
}
}
#ifdef PROPS_PRESENT
for (int i = 0; i < _data->get_prop_data_count(); ++i) {
Ref<WorldGeneratorPropData> s = _data->get_prop_data(i);
@ -179,6 +180,7 @@ void Biome::_setup_library(Ref<VoxelmanLibrary> library) {
library->add_prop(s->get_prop());
}
}
#endif
}
#else
void Biome::setup_library(Ref<Resource> library) {

View File

@ -183,6 +183,7 @@ void DungeonRoom::_setup_library(Ref<VoxelmanLibrary> library) {
}
}
#ifdef PROPS_PRESENT
for (int i = 0; i < _data->get_prop_data_count(); ++i) {
Ref<WorldGeneratorPropData> s = _data->get_prop_data(i);
@ -193,6 +194,7 @@ void DungeonRoom::_setup_library(Ref<VoxelmanLibrary> library) {
library->add_prop(pd);
}
}
#endif
}
void DungeonRoom::generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs) {