From 850a54a2a55f26a447967f47f99d09cfc2874b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 29 Jun 2019 21:45:14 +0200 Subject: [PATCH] Fix uninitialized variables in Line2D, JSONParseResult and TileMap --- core/bind/core_bind.h | 3 +++ doc/classes/JSONParseResult.xml | 2 +- doc/classes/Line2D.xml | 2 +- doc/classes/TileMap.xml | 2 +- scene/2d/line_2d.cpp | 1 + scene/2d/tile_map.cpp | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 2885e7c0e03..3be5a087528 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -805,6 +805,9 @@ public: void set_result(const Variant &p_result); Variant get_result() const; + + JSONParseResult() : + error_line(-1) {} }; class _JSON : public Object { diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml index 5d5d4924394..98db123f5b8 100644 --- a/doc/classes/JSONParseResult.xml +++ b/doc/classes/JSONParseResult.xml @@ -14,7 +14,7 @@ The error type if the JSON source was not successfully parsed. See the [@GlobalScope] [code]ERR_*[/code] constants. - + The line number where the error occurred if JSON source was not successfully parsed. diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index 1fdf337f4be..27d3f4bade4 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -93,7 +93,7 @@ The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style. - + The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants. diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index ee5205efd71..55666b94b59 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -286,7 +286,7 @@ The collision mask(s) for all colliders in the TileMap. - + If [code]true[/code], TileMap collisions will be handled as a kinematic body. If [code]false[/code], collisions will be handled as static body. diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp index 4488dc501cb..1c8245d1596 100644 --- a/scene/2d/line_2d.cpp +++ b/scene/2d/line_2d.cpp @@ -44,6 +44,7 @@ Line2D::Line2D() { _end_cap_mode = LINE_CAP_NONE; _width = 10; _default_color = Color(0.4, 0.5, 1); + _texture_mode = LINE_TEXTURE_NONE; _sharp_limit = 2.f; _round_precision = 8; } diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index bf59fa0ba8b..fc53c9e4ace 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1829,6 +1829,7 @@ TileMap::TileMap() { half_offset = HALF_OFFSET_DISABLED; use_parent = false; collision_parent = NULL; + use_kinematic = false; navigation = NULL; y_sort_mode = false; occluder_light_mask = 1;