Skip to content

Commit 2ce3be2

Browse files
Correctly set GDScript internal path for shallow scripts
1 parent 78d9194 commit 2ce3be2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

modules/gdscript/gdscript.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,13 @@ void GDScript::set_path_cache(const String &p_path) {
10781078
if (is_root_script()) {
10791079
Script::set_path_cache(p_path);
10801080
}
1081+
1082+
path = p_path;
1083+
path_valid = true;
1084+
1085+
for (KeyValue<StringName, Ref<GDScript>> &kv : subclasses) {
1086+
kv.value->set_path_cache(p_path);
1087+
}
10811088
}
10821089

10831090
void GDScript::set_path(const String &p_path, bool p_take_over) {

modules/gdscript/gdscript_cache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ thread_local SafeBinaryMutex<GDScriptCache::BINARY_MUTEX_TAG>::TLSData SafeBinar
153153
SafeBinaryMutex<GDScriptCache::BINARY_MUTEX_TAG> GDScriptCache::mutex;
154154

155155
void GDScriptCache::move_script(const String &p_from, const String &p_to) {
156-
if (singleton == nullptr || p_from == p_to) {
156+
if (singleton == nullptr || p_from == p_to || p_from.is_empty()) {
157157
return;
158158
}
159159

0 commit comments

Comments
 (0)