summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gd_parser.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-07 02:04:20 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-07 02:04:20 -0300
commitc79be979d47daae613d1b1bbc732a30a74f56543 (patch)
tree9edaf684a8d3ff47b124d03e04c01f927c197255 /modules/gdscript/gd_parser.cpp
parentf7c9a4a0a8ab770dfe565c31c7c47585beb53594 (diff)
downloadredot-engine-c79be979d47daae613d1b1bbc732a30a74f56543.tar.gz
Batch of Bugfixes
-=-=-=-=-=-=-=-=- -Fixed Export UV XForm (should work now). #923 -Fixed enforcement of limits in property editor. #919 -Fixed long-standing bug of export editings in script inheritance. #914, #859, #756 -Fixed horrible error reporting in shader language. #912 -Added kinematic collision with plane (please test well). #911 -Fixed double animation track insert when using 2D rigs. #904 -VKey updates offset parameter in sprite edition. #901 -Do not allow anymore a script to preload itself. (does not fix #899, but narrows it down) -Avoid connection editor from overriding selected text. #897 -Fixed timer autostart. #876 -Fixed collision layers in 3D physics. #872 -Improved operators in shader #857 -Fixed ambient lighting bug #834 -Avoid editor from processing gamepad input #813 -Added not keyword #752 Please test!
Diffstat (limited to 'modules/gdscript/gd_parser.cpp')
-rw-r--r--modules/gdscript/gd_parser.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index de2b5219a9..904b6ba52f 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -225,7 +225,14 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
String path = tokenizer->get_token_constant();
if (!path.is_abs_path() && base_path!="")
path=base_path+"/"+path;
- path = path.replace("///","//");
+ path = path.replace("///","//").simplify_path();
+ if (path==self_path) {
+
+ _set_error("Can't preload itself (use 'get_script()').");
+ return NULL;
+
+ }
+
Ref<Resource> res;
if (!validating) {
@@ -2616,8 +2623,9 @@ Error GDParser::_parse(const String& p_base_path) {
return OK;
}
-Error GDParser::parse_bytecode(const Vector<uint8_t> &p_bytecode,const String& p_base_path) {
+Error GDParser::parse_bytecode(const Vector<uint8_t> &p_bytecode,const String& p_base_path, const String &p_self_path) {
+ self_path=p_self_path;
GDTokenizerBuffer *tb = memnew( GDTokenizerBuffer );
tb->set_code_buffer(p_bytecode);
tokenizer=tb;
@@ -2628,9 +2636,9 @@ Error GDParser::parse_bytecode(const Vector<uint8_t> &p_bytecode,const String& p
}
-Error GDParser::parse(const String& p_code,const String& p_base_path,bool p_just_validate) {
-
+Error GDParser::parse(const String& p_code, const String& p_base_path, bool p_just_validate, const String &p_self_path) {
+ self_path=p_self_path;
GDTokenizerText *tt = memnew( GDTokenizerText );
tt->set_code(p_code);