You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
-fix assignment to vector types in script using integer indices crash (#978)
This commit is contained in:
@@ -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);
|
Vector2 *v=reinterpret_cast<Vector2*>(_data._mem);
|
||||||
valid=true;
|
valid=true;
|
||||||
v[idx]=p_value;
|
(*v)[idx]=p_value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (p_index.get_type()==Variant::STRING) {
|
} 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);
|
Vector3 *v=reinterpret_cast<Vector3*>(_data._mem);
|
||||||
valid=true;
|
valid=true;
|
||||||
v[idx]=p_value;
|
(*v)[idx]=p_value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (p_index.get_type()==Variant::STRING) {
|
} else if (p_index.get_type()==Variant::STRING) {
|
||||||
|
|||||||
Reference in New Issue
Block a user