Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fixed resource loader using not fully loaded scripts" #102429

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,26 +1075,6 @@ void GDScript::_bind_methods() {
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "new", &GDScript::_new, MethodInfo("new"));
}

void GDScript::set_path_cache(const String &p_path) {
if (ResourceCache::has(p_path)) {
set_path(p_path, true);
return;
}

if (is_root_script()) {
Script::set_path_cache(p_path);
}

String old_path = path;
path = p_path;
path_valid = true;
GDScriptCache::move_script(old_path, p_path);

for (KeyValue<StringName, Ref<GDScript>> &kv : subclasses) {
kv.value->set_path_cache(p_path);
}
}

void GDScript::set_path(const String &p_path, bool p_take_over) {
if (is_root_script()) {
Script::set_path(p_path, p_take_over);
Expand Down
1 change: 0 additions & 1 deletion modules/gdscript/gdscript.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ class GDScript : public Script {

virtual Error reload(bool p_keep_state = false) override;

virtual void set_path_cache(const String &p_path) override;
virtual void set_path(const String &p_path, bool p_take_over = false) override;
String get_script_path() const;
Error load_source_code(const String &p_path);
Expand Down
3 changes: 1 addition & 2 deletions modules/gdscript/gdscript_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, Error &r_e

Ref<GDScript> script;
script.instantiate();
script->set_path_cache(p_path);
script->set_path(p_path, true);
if (remapped_path.get_extension().to_lower() == "gdc") {
Vector<uint8_t> buffer = get_binary_tokens(remapped_path);
if (buffer.is_empty()) {
Expand Down Expand Up @@ -360,7 +360,6 @@ Ref<GDScript> GDScriptCache::get_full_script(const String &p_path, Error &r_erro
return script;
}
}
script->set_path(p_path, true);

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

Expand Down