diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2024-02-15 17:16:39 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2024-02-15 17:53:24 +0300 |
commit | a2e3e31e8077090d557b6306383106580a29c2c6 (patch) | |
tree | dc505f86448b73a136fc1d2dd6c5f8d0defde65a /modules/gdscript/gdscript.cpp | |
parent | 907db8eebcecb97d527edcaff77a1c87a6c068f5 (diff) | |
download | redot-engine-a2e3e31e8077090d557b6306383106580a29c2c6.tar.gz |
GDScript: Fix extension comparison for exported scripts
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index d7aaf4ce10..4396232c37 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1405,6 +1405,18 @@ String GDScript::debug_get_script_name(const Ref<Script> &p_script) { } #endif +bool GDScript::is_equal_gdscript_paths(const String &p_path_a, const String &p_path_b) { + String path_a = p_path_a; + if (path_a.get_extension() == "gdc") { + path_a = path_a.get_basename() + ".gd"; + } + String path_b = p_path_b; + if (path_b.get_extension() == "gdc") { + path_b = path_b.get_basename() + ".gd"; + } + return path_a == path_b; +} + GDScript::UpdatableFuncPtr::UpdatableFuncPtr(GDScriptFunction *p_function) { if (p_function == nullptr) { return; |