Skip to content

Commit daa0748

Browse files
committed
Revert "Fixed resource loader using not fully loaded scripts"
This reverts commit fd5fc9f. This caused significant regressions which are worse than the bug that godotengine#96499 aimed to address. - Reverts godotengine#96499. - Reopens godotengine#95909. - Supersedes godotengine#102063. - Fixes godotengine#99006. - Fixes godotengine#101615.
1 parent 0b6a717 commit daa0748

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

modules/gdscript/gdscript.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,26 +1075,6 @@ void GDScript::_bind_methods() {
10751075
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "new", &GDScript::_new, MethodInfo("new"));
10761076
}
10771077

1078-
void GDScript::set_path_cache(const String &p_path) {
1079-
if (ResourceCache::has(p_path)) {
1080-
set_path(p_path, true);
1081-
return;
1082-
}
1083-
1084-
if (is_root_script()) {
1085-
Script::set_path_cache(p_path);
1086-
}
1087-
1088-
String old_path = path;
1089-
path = p_path;
1090-
path_valid = true;
1091-
GDScriptCache::move_script(old_path, p_path);
1092-
1093-
for (KeyValue<StringName, Ref<GDScript>> &kv : subclasses) {
1094-
kv.value->set_path_cache(p_path);
1095-
}
1096-
}
1097-
10981078
void GDScript::set_path(const String &p_path, bool p_take_over) {
10991079
if (is_root_script()) {
11001080
Script::set_path(p_path, p_take_over);

modules/gdscript/gdscript.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ class GDScript : public Script {
309309

310310
virtual Error reload(bool p_keep_state = false) override;
311311

312-
virtual void set_path_cache(const String &p_path) override;
313312
virtual void set_path(const String &p_path, bool p_take_over = false) override;
314313
String get_script_path() const;
315314
Error load_source_code(const String &p_path);

modules/gdscript/gdscript_cache.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, Error &r_e
312312

313313
Ref<GDScript> script;
314314
script.instantiate();
315-
script->set_path_cache(p_path);
315+
script->set_path(p_path, true);
316316
if (remapped_path.get_extension().to_lower() == "gdc") {
317317
Vector<uint8_t> buffer = get_binary_tokens(remapped_path);
318318
if (buffer.is_empty()) {
@@ -360,7 +360,6 @@ Ref<GDScript> GDScriptCache::get_full_script(const String &p_path, Error &r_erro
360360
return script;
361361
}
362362
}
363-
script->set_path(p_path, true);
364363

365364
const String remapped_path = ResourceLoader::path_remap(p_path);
366365

0 commit comments

Comments
 (0)