Fixes ERR_EXPLAIN being overwritten

This commit is contained in:
Ignacio Etcheverry 2017-09-06 04:43:07 +02:00
parent e192c1a7d3
commit 96b205d2ed

View File

@ -69,12 +69,11 @@ void Resource::set_path(const String &p_path, bool p_take_over) {
ResourceCache::resources.get(p_path)->set_name(""); ResourceCache::resources.get(p_path)->set_name("");
ResourceCache::lock->write_unlock(); ResourceCache::lock->write_unlock();
} else { } else {
ERR_EXPLAIN("Another resource is loaded from path: " + p_path);
ResourceCache::lock->read_lock(); ResourceCache::lock->read_lock();
bool exists = ResourceCache::resources.has(p_path); bool exists = ResourceCache::resources.has(p_path);
ResourceCache::lock->read_unlock(); ResourceCache::lock->read_unlock();
ERR_EXPLAIN("Another resource is loaded from path: " + p_path);
ERR_FAIL_COND(exists); ERR_FAIL_COND(exists);
} }
} }