diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-03-08 00:12:19 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-03-08 00:12:19 +0100 |
commit | a4825c2f8b5c74bb50f7df158bc1f849ec46ee07 (patch) | |
tree | 5164eeef08233870a16bba558b2b49175d52ce05 /modules/mono | |
parent | 201cb8d7ed8134eb21d41189025b8619557b7e1d (diff) |
Fix CSharpInstance::set not working with base classes
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/csharp_script.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 71c21e0aa1..04405e0c1d 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1315,14 +1315,14 @@ bool CSharpInstance::set(const StringName &p_name, const Variant &p_value) { GDMonoClass *top = script->script_class; while (top && top != script->native) { - GDMonoField *field = script->script_class->get_field(p_name); + GDMonoField *field = top->get_field(p_name); if (field) { field->set_value_from_variant(mono_object, p_value); return true; } - GDMonoProperty *property = script->script_class->get_property(p_name); + GDMonoProperty *property = top->get_property(p_name); if (property) { property->set_value(mono_object, GDMonoMarshal::variant_to_mono_object(p_value, property->get_type())); |