From 7c0051beac315ad9c8896064d24ae362f5a65f7f Mon Sep 17 00:00:00 2001 From: Jaguar Date: Sat, 13 Jun 2015 14:10:06 -0400 Subject: Fixed variables being set before calling the setter method --- modules/gdscript/gd_script.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/gdscript/gd_script.cpp') diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index ceca1ff2b..70a5fd985 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -2131,7 +2131,6 @@ bool GDInstance::set(const StringName& p_name, const Variant& p_value) { { const Map::Element *E = script->member_indices.find(p_name); if (E) { - members[E->get().index]=p_value; if (E->get().setter) { const Variant *val=&p_value; Variant::CallError err; @@ -2140,6 +2139,8 @@ bool GDInstance::set(const StringName& p_name, const Variant& p_value) { return true; //function exists, call was successful } } + else + members[E->get().index] = p_value; return true; } } -- cgit v1.2.3-70-g09d2 From 48f1d02da4795ba9d485fe5fe2bea907be2fc467 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 24 Jun 2015 13:29:23 -0300 Subject: added ability to define signals in script closes #2175 --- core/object.cpp | 9 +++ core/script_language.h | 4 + demos/2d/space_shooter/shot.gd | 1 + demos/2d/space_shooter/shot.scn | Bin 3990 -> 4079 bytes modules/gdscript/gd_compiler.cpp | 40 +++++++--- modules/gdscript/gd_parser.cpp | 71 +++++++++++++++-- modules/gdscript/gd_parser.h | 7 ++ modules/gdscript/gd_script.cpp | 48 ++++++++++++ modules/gdscript/gd_script.h | 4 + modules/gdscript/gd_tokenizer.cpp | 1 + modules/gdscript/gd_tokenizer.h | 1 + tools/editor/connections_dialog.cpp | 148 +++++++++++++++++++++++++----------- 12 files changed, 270 insertions(+), 64 deletions(-) (limited to 'modules/gdscript/gd_script.cpp') diff --git a/core/object.cpp b/core/object.cpp index cdb2c6517..6bb7973ce 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1302,6 +1302,10 @@ Array Object::_get_signal_connection_list(const String& p_signal) const{ void Object::get_signal_list(List *p_signals ) const { + if (!script.is_null()) { + Ref