Skip to content

Commit c5ef5e2

Browse files
committed
fix: remove changes on JvmScript::get_base_script
1 parent 9bb7ee6 commit c5ef5e2

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

src/resource_format/jvm_resource_format_loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ResourceUID::ID JvmResourceFormatLoader::get_resource_uid(const String& p_path)
102102
if (extension == GODOT_JVM_REGISTRATION_FILE_EXTENSION) {
103103
id = (JvmScript::get_script_file_name(p_path) + UUID_HASH_SEED).hash64();
104104
id &= 0x7FFFFFFFFFFFFFFF;
105-
} else if (extension == GODOT_KOTLIN_SCRIPT_EXTENSION || extension == GODOT_JAVA_SCRIPT_EXTENSION) {
105+
} else if (extension == GODOT_KOTLIN_SCRIPT_EXTENSION || extension == GODOT_JAVA_SCRIPT_EXTENSION || extension == GODOT_SCALA_SCRIPT_EXTENSION) {
106106
String source;
107107
Error error;
108108
id = (String(SourceScript::parse_source_to_fqdn(p_path, source, &error)) + UUID_HASH_SEED).hash64();

src/script/jvm_script.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,7 @@ bool JvmScript::inherits_script(const Ref<Script>& p_script) const {
6060
Ref<Script> JvmScript::get_base_script() const {
6161
if (!is_valid() || kotlin_class->registered_supertypes.size() == 0) { return {}; }
6262
StringName parent_name = kotlin_class->registered_supertypes[0];
63-
64-
//TODO: Remove with 4.4 when NamedScript names are GUIDs
65-
for (const Dictionary& item: ProjectSettings::get_singleton()->get_global_class_list()) {
66-
String class_name = item["class"];
67-
if (class_name != parent_name) {
68-
continue;
69-
}
70-
71-
String script_path = item["path"];
72-
return ResourceLoader::load(script_path);
73-
}
74-
75-
return {};
63+
return JvmScriptManager::get_instance()->get_script_from_name(parent_name);
7664
}
7765

7866
StringName JvmScript::get_instance_base_type() const {

src/script/jvm_script.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "core/object/script_language.h"
55
#include "jvm_wrapper/registration/kt_class.h"
6+
#include "resource_format/hash.h"
67

78
class JvmInstance;
89

0 commit comments

Comments
 (0)