Fix uninitialized variables in Line2D, JSONParseResult and TileMap

This commit is contained in:
Rémi Verschelde 2019-06-29 21:45:14 +02:00
parent 26f99beac3
commit 850a54a2a5
6 changed files with 8 additions and 3 deletions

View file

@ -805,6 +805,9 @@ public:
void set_result(const Variant &p_result);
Variant get_result() const;
JSONParseResult() :
error_line(-1) {}
};
class _JSON : public Object {

View file

@ -14,7 +14,7 @@
<member name="error" type="int" setter="set_error" getter="get_error" enum="Error">
The error type if the JSON source was not successfully parsed. See the [@GlobalScope] [code]ERR_*[/code] constants.
</member>
<member name="error_line" type="int" setter="set_error_line" getter="get_error_line" default="116547728">
<member name="error_line" type="int" setter="set_error_line" getter="get_error_line" default="-1">
The line number where the error occurred if JSON source was not successfully parsed.
</member>
<member name="error_string" type="String" setter="set_error_string" getter="get_error_string" default="&quot;&quot;">

View file

@ -93,7 +93,7 @@
<member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null">
The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style.
</member>
<member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode" default="1101004800">
<member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode" default="0">
The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants.
</member>
<member name="width" type="float" setter="set_width" getter="get_width" default="10.0">

View file

@ -286,7 +286,7 @@
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
The collision mask(s) for all colliders in the TileMap.
</member>
<member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic" default="true">
<member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic" default="false">
If [code]true[/code], TileMap collisions will be handled as a kinematic body. If [code]false[/code], collisions will be handled as static body.
</member>
<member name="collision_use_parent" type="bool" setter="set_collision_use_parent" getter="get_collision_use_parent" default="false">

View file

@ -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;
}

View file

@ -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;