From ae2d4490472a129b2f7d73efac0b4dbf257a8018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 16 Aug 2017 03:01:41 +0200 Subject: Revive inspector property evaluation GDScript was restricted to parse only scripts beginning with __res://__ or __user://__ to avoid templates from being parsed. I've made that a bit less inclusive by allowing scripts with an empty path to be parsed too, which doesn't conflict and is needed for this to work. Also I've removed the `this` variable of the generated script and made the relevant object to be the one the script instance refers to, so you can use `self` instead. Now, with the shorter 3.0-style syntax, you can write things like: `self.position.x + 10` Closes #9500. --- modules/gdscript/gd_script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 9d304c6d34..2d06c0f5d2 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -615,7 +615,7 @@ Error GDScript::reload(bool p_keep_state) { if (basedir != "") basedir = basedir.get_base_dir(); - if (basedir.find("res://") == -1 && basedir.find("user://") == -1) { + if (basedir != "" && basedir.find("res://") == -1 && basedir.find("user://") == -1) { //loading a template, don't parse return OK; } -- cgit v1.2.3