From 9ddb3265e1a6d2f9937ff6a27d04302d76c10431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Fri, 1 Nov 2019 16:16:31 +0100 Subject: Fix some crashes, overflows and using variables without values --- scene/resources/ray_shape.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scene/resources/ray_shape.cpp') diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index 5a696aee23..f185263a36 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -90,6 +90,12 @@ void RayShape::_bind_methods() { RayShape::RayShape() : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_RAY)) { - set_length(1.0); - set_slips_on_slope(false); + length = 1.0; + slips_on_slope = false; + + /* Code copied from setters to prevent the use of uninitialized variables */ + _update_shape(); + notify_change_to_owners(); + _change_notify("length"); + _change_notify("slips_on_slope"); } -- cgit v1.2.3