mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 18:43:29 -05:00
Improve missing UID errors
This commit is contained in:
parent
abf8e1e6f9
commit
d3d874e0d1
1 changed files with 5 additions and 2 deletions
|
@ -151,11 +151,14 @@ void ResourceUID::set_id(ID p_id, const String &p_path) {
|
|||
}
|
||||
|
||||
String ResourceUID::get_id_path(ID p_id) const {
|
||||
ERR_FAIL_COND_V_MSG(p_id == INVALID_ID, String(), "Invalid UID.");
|
||||
MutexLock l(mutex);
|
||||
ERR_FAIL_COND_V(!unique_ids.has(p_id), String());
|
||||
const CharString &cs = unique_ids[p_id].cs;
|
||||
const ResourceUID::Cache *cache = unique_ids.getptr(p_id);
|
||||
ERR_FAIL_COND_V_MSG(!cache, String(), vformat("Unrecognized UID: \"%s\".", id_to_text(p_id)));
|
||||
const CharString &cs = cache->cs;
|
||||
return String::utf8(cs.ptr());
|
||||
}
|
||||
|
||||
void ResourceUID::remove_id(ID p_id) {
|
||||
MutexLock l(mutex);
|
||||
ERR_FAIL_COND(!unique_ids.has(p_id));
|
||||
|
|
Loading…
Reference in a new issue