1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #66548 from akien-mga/msvc-warnings-c4701-c4703

Fix MSVC warnings C4701 and C4703: Potentially uninitialized variable used
This commit is contained in:
Rémi Verschelde
2022-09-28 20:47:50 +02:00
8 changed files with 17 additions and 15 deletions

View File

@@ -129,8 +129,8 @@ bool GodotPhysicsDirectSpaceState2D::intersect_ray(const RayParameters &p_parame
bool collided = false;
Vector2 res_point, res_normal;
int res_shape;
const GodotCollisionObject2D *res_obj;
int res_shape = -1;
const GodotCollisionObject2D *res_obj = nullptr;
real_t min_d = 1e10;
for (int i = 0; i < amount; i++) {
@@ -190,6 +190,7 @@ bool GodotPhysicsDirectSpaceState2D::intersect_ray(const RayParameters &p_parame
if (!collided) {
return false;
}
ERR_FAIL_NULL_V(res_obj, false); // Shouldn't happen but silences warning.
r_result.collider_id = res_obj->get_instance_id();
if (r_result.collider_id.is_valid()) {