Fix getting struct elements from MonoArray (#11978)

* Fix getting struct elements from MonoArray
* Revert undesired change
This commit is contained in:
Ignacio Etcheverry 2017-10-10 00:25:36 +02:00 committed by GitHub
parent f240cfe5a9
commit 18d3ba0c50
2 changed files with 5 additions and 4 deletions

View File

@ -285,7 +285,8 @@ bool GDMono::_load_assembly(const String &p_name, GDMonoAssembly **r_assembly) {
MonoAssembly *assembly = mono_assembly_load_full(aname, NULL, &status, false);
mono_assembly_name_free(aname);
ERR_FAIL_NULL_V(assembly, false);
if (!assembly)
return false;
uint32_t domain_id = mono_domain_get_id(mono_domain_get());

View File

@ -719,7 +719,7 @@ PoolColorArray mono_array_to_PoolColorArray(MonoArray *p_array) {
int length = mono_array_length(p_array);
for (int i = 0; i < length; i++) {
real_t *raw_elem = mono_array_get(p_array, real_t *, i);
real_t *raw_elem = (real_t *)mono_array_addr_with_size(p_array, sizeof(real_t) * 4, i);
MARSHALLED_IN(Color, raw_elem, elem);
ret.push_back(elem);
}
@ -749,7 +749,7 @@ PoolVector2Array mono_array_to_PoolVector2Array(MonoArray *p_array) {
int length = mono_array_length(p_array);
for (int i = 0; i < length; i++) {
real_t *raw_elem = mono_array_get(p_array, real_t *, i);
real_t *raw_elem = (real_t *)mono_array_addr_with_size(p_array, sizeof(real_t) * 2, i);
MARSHALLED_IN(Vector2, raw_elem, elem);
ret.push_back(elem);
}
@ -780,7 +780,7 @@ PoolVector3Array mono_array_to_PoolVector3Array(MonoArray *p_array) {
int length = mono_array_length(p_array);
for (int i = 0; i < length; i++) {
real_t *raw_elem = mono_array_get(p_array, real_t *, i);
real_t *raw_elem = (real_t *)mono_array_addr_with_size(p_array, sizeof(real_t) * 3, i);
MARSHALLED_IN(Vector3, raw_elem, elem);
ret.push_back(elem);
}