Explorar o código

-fix assignment to vector types in script using integer indices crash (#978)

Juan Linietsky %!s(int64=10) %!d(string=hai) anos
pai
achega
2144648a3d
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      core/variant_op.cpp

+ 2 - 2
core/variant_op.cpp

@@ -961,7 +961,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
 
 					Vector2 *v=reinterpret_cast<Vector2*>(_data._mem);
 					valid=true;
-					v[idx]=p_value;
+					(*v)[idx]=p_value;
 					return;
 				}
 			} else if (p_index.get_type()==Variant::STRING) {
@@ -1055,7 +1055,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
 
 					Vector3 *v=reinterpret_cast<Vector3*>(_data._mem);
 					valid=true;
-					v[idx]=p_value;
+					(*v)[idx]=p_value;
 					return;
 				}
 			} else if (p_index.get_type()==Variant::STRING) {