Change the unreacheable return value of shape_find_owner()
(cherry picked from commit 563d3dbf94
)
This commit is contained in:
parent
f0dabe4ac5
commit
fa2feb9bec
2 changed files with 4 additions and 4 deletions
|
@ -352,7 +352,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 Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
|
||||
for (int i = 0; i < E->get().shapes.size(); i++) {
|
||||
|
@ -363,7 +363,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) {
|
||||
|
|
|
@ -525,7 +525,7 @@ void CollisionObject::shape_owner_clear_shapes(uint32_t p_owner) {
|
|||
}
|
||||
|
||||
uint32_t CollisionObject::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 Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) {
|
||||
for (int i = 0; i < E->get().shapes.size(); i++) {
|
||||
|
@ -536,7 +536,7 @@ uint32_t CollisionObject::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) + ".");
|
||||
}
|
||||
|
||||
CollisionObject::CollisionObject(RID p_rid, bool p_area) {
|
||||
|
|
Loading…
Reference in a new issue