diff options
author | Bastiaan Olij <mux213@gmail.com> | 2021-11-17 10:36:29 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2021-11-17 10:36:29 +1100 |
commit | 035468669ae5a1587391f5b85bf3822715d6279b (patch) | |
tree | 4bfc0a7279f13caeb4626b16fd50af57412ecf14 /core/extension | |
parent | 184b5244ba501d2323c4bf8631695bd873da9bd9 (diff) |
Fix array access in gdextensions
Diffstat (limited to 'core/extension')
-rw-r--r-- | core/extension/gdnative_interface.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/extension/gdnative_interface.cpp b/core/extension/gdnative_interface.cpp index 4770c9c65f..a65408fdda 100644 --- a/core/extension/gdnative_interface.cpp +++ b/core/extension/gdnative_interface.cpp @@ -774,13 +774,13 @@ static GDNativeTypePtr gdnative_packed_vector3_array_operator_index_const(const static GDNativeVariantPtr gdnative_array_operator_index(GDNativeTypePtr p_self, GDNativeInt p_index) { Array *self = (Array *)p_self; ERR_FAIL_INDEX_V(p_index, self->size(), nullptr); - return (GDNativeTypePtr)&self[p_index]; + return (GDNativeVariantPtr)&self->operator[](p_index); } static GDNativeVariantPtr gdnative_array_operator_index_const(const GDNativeTypePtr p_self, GDNativeInt p_index) { const Array *self = (const Array *)p_self; ERR_FAIL_INDEX_V(p_index, self->size(), nullptr); - return (GDNativeTypePtr)&self[p_index]; + return (GDNativeVariantPtr)&self->operator[](p_index); } /* OBJECT API */ |