aboutsummaryrefslogtreecommitdiff
path: root/script/gdscript/gd_script.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2014-02-15 21:16:33 -0300
committerJuan Linietsky2014-02-15 21:16:33 -0300
commit8c1731b67995add31361ae526b0e6af76346181e (patch)
treef96080fdbb6e0f0f3fcc12bf10fc92928f0310cb /script/gdscript/gd_script.cpp
parent9afdb3e0ad5bfbdafe307212f5d4ebcc7c3ac852 (diff)
downloadgodot-8c1731b67995add31361ae526b0e6af76346181e.tar.gz
godot-8c1731b67995add31361ae526b0e6af76346181e.tar.zst
godot-8c1731b67995add31361ae526b0e6af76346181e.zip
Diffstat (limited to 'script/gdscript/gd_script.cpp')
-rw-r--r--script/gdscript/gd_script.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/script/gdscript/gd_script.cpp b/script/gdscript/gd_script.cpp
index 891cede03..5679e1e06 100644
--- a/script/gdscript/gd_script.cpp
+++ b/script/gdscript/gd_script.cpp
@@ -1524,21 +1524,21 @@ bool GDScript::_get(const StringName& p_name,Variant &r_ret) const {
top=top->_base;
}
- return false;
- }
+ if (p_name==GDScriptLanguage::get_singleton()->strings._script_source) {
+ r_ret=get_source_code();
+ return true;
+ }
+ }
- if (p_name=="script/source") {
- r_ret=get_source_code();
- }
- return true;
+ return false;
}
bool GDScript::_set(const StringName& p_name, const Variant& p_value) {
- if (p_name=="script/source") {
+ if (p_name==GDScriptLanguage::get_singleton()->strings._script_source) {
set_source_code(p_value);
reload();
@@ -2115,6 +2115,7 @@ GDScriptLanguage::GDScriptLanguage() {
strings._set= StaticCString::create("_set");
strings._get= StaticCString::create("_get");
strings._get_property_list= StaticCString::create("_get_property_list");
+ strings._script_source=StaticCString::create("script/source");
_debug_parse_err_line=-1;
_debug_parse_err_file="";