mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
-fix assignment to vector types in script using integer indices crash (#978)
This commit is contained in:
parent
8a28af024e
commit
2144648a3d
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user