Show an error when setting a negative size on a collision shape
This commit is contained in:
parent
499eec13a3
commit
9f048f4c4d
7 changed files with 10 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ bool RectangleShape2D::_get(const StringName &p_name, Variant &r_property) const
|
|||
#endif // DISABLE_DEPRECATED
|
||||
|
||||
void RectangleShape2D::set_size(const Vector2 &p_size) {
|
||||
ERR_FAIL_COND_MSG(p_size.x < 0 || p_size.y < 0, "RectangleShape2D size cannot be negative.");
|
||||
size = p_size;
|
||||
_update_shape();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue