mirror of
https://github.com/godotengine/godot.git
synced 2025-02-17 22:43:01 +08:00
Merge pull request #53990 from Kemikal1/master
Change the unreacheable return value of shape_find_owner()
This commit is contained in:
commit
e06d264362
@ -454,7 +454,7 @@ void CollisionObject2D::shape_owner_clear_shapes(uint32_t p_owner) {
|
||||
}
|
||||
|
||||
uint32_t CollisionObject2D::shape_find_owner(int p_shape_index) const {
|
||||
ERR_FAIL_INDEX_V(p_shape_index, total_subshapes, 0);
|
||||
ERR_FAIL_INDEX_V(p_shape_index, total_subshapes, UINT32_MAX);
|
||||
|
||||
for (const KeyValue<uint32_t, ShapeData> &E : shapes) {
|
||||
for (int i = 0; i < E.value.shapes.size(); i++) {
|
||||
@ -465,7 +465,7 @@ uint32_t CollisionObject2D::shape_find_owner(int p_shape_index) const {
|
||||
}
|
||||
|
||||
//in theory it should be unreachable
|
||||
return 0;
|
||||
ERR_FAIL_V_MSG(UINT32_MAX, "Can't find owner for shape index " + itos(p_shape_index) + ".");
|
||||
}
|
||||
|
||||
void CollisionObject2D::set_pickable(bool p_enabled) {
|
||||
|
@ -648,7 +648,7 @@ void CollisionObject3D::shape_owner_clear_shapes(uint32_t p_owner) {
|
||||
}
|
||||
|
||||
uint32_t CollisionObject3D::shape_find_owner(int p_shape_index) const {
|
||||
ERR_FAIL_INDEX_V(p_shape_index, total_subshapes, 0);
|
||||
ERR_FAIL_INDEX_V(p_shape_index, total_subshapes, UINT32_MAX);
|
||||
|
||||
for (const KeyValue<uint32_t, ShapeData> &E : shapes) {
|
||||
for (int i = 0; i < E.value.shapes.size(); i++) {
|
||||
@ -659,7 +659,7 @@ uint32_t CollisionObject3D::shape_find_owner(int p_shape_index) const {
|
||||
}
|
||||
|
||||
//in theory it should be unreachable
|
||||
return 0;
|
||||
ERR_FAIL_V_MSG(UINT32_MAX, "Can't find owner for shape index " + itos(p_shape_index) + ".");
|
||||
}
|
||||
|
||||
CollisionObject3D::CollisionObject3D(RID p_rid, bool p_area) {
|
||||
|
Loading…
Reference in New Issue
Block a user