mirror of
https://github.com/Relintai/props.git
synced 2024-11-12 10:15:25 +01:00
Check whether the cache has materials instead of whether it's initialized or not in PropInstanceMerger::_build.
This commit is contained in:
parent
5f915d4dd2
commit
6fe7427b03
@ -542,13 +542,13 @@ void PropInstanceMerger::_build() {
|
||||
|
||||
Ref<PropMaterialCache> cache = PropCache::get_singleton()->material_cache_get(_prop_data);
|
||||
|
||||
if (!cache->get_initialized()) {
|
||||
if (cache->material_get_num() == 0) {
|
||||
//lock it!
|
||||
cache->mutex_lock();
|
||||
|
||||
//check again, this thread might have gotten here after an another one already did the initialization!
|
||||
//this check might not be needed here
|
||||
if (!cache->get_initialized()) {
|
||||
if (cache->material_get_num() == 0) {
|
||||
//this will set up materials, and settings
|
||||
//needs to be called from the main thread!
|
||||
cache->initial_setup_default();
|
||||
|
Loading…
Reference in New Issue
Block a user