diff options
| author | Ignacio Etcheverry | 2017-10-17 14:02:19 +0200 |
|---|---|---|
| committer | Ignacio Etcheverry | 2017-10-17 14:42:13 +0200 |
| commit | 6e6b455d1fe791894e1a6bd66e1f5f8471c02abc (patch) | |
| tree | 43863242fc7677aed0684dda7b06ddb9551b3806 /modules/mono/mono_gd/gd_mono_field.cpp | |
| parent | 1b2e09355e890ae32fe172aad19dcda137ed636f (diff) | |
| download | godot-6e6b455d1fe791894e1a6bd66e1f5f8471c02abc.tar.gz godot-6e6b455d1fe791894e1a6bd66e1f5f8471c02abc.tar.zst godot-6e6b455d1fe791894e1a6bd66e1f5f8471c02abc.zip | |
Diffstat (limited to 'modules/mono/mono_gd/gd_mono_field.cpp')
| -rw-r--r-- | modules/mono/mono_gd/gd_mono_field.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/mono/mono_gd/gd_mono_field.cpp b/modules/mono/mono_gd/gd_mono_field.cpp index c2d8eeaa3..81315ee87 100644 --- a/modules/mono/mono_gd/gd_mono_field.cpp +++ b/modules/mono/mono_gd/gd_mono_field.cpp @@ -51,6 +51,7 @@ void GDMonoField::set_value(MonoObject *p_object, const Variant &p_value) { { \ m_type val = p_value.operator m_type(); \ mono_field_set_value(p_object, mono_field, &val); \ + break; \ } #define SET_FROM_ARRAY_AND_BREAK(m_type) \ @@ -137,6 +138,9 @@ void GDMonoField::set_value(MonoObject *p_object, const Variant &p_value) { if (tclass == CACHED_CLASS(Plane)) SET_FROM_STRUCT_AND_BREAK(Plane); + if (mono_class_is_enum(tclass->get_raw())) + SET_FROM_PRIMITIVE(signed int); + ERR_EXPLAIN(String() + "Attempted to set the value of a field of unmarshallable type: " + tclass->get_name()); ERR_FAIL(); } break; |
