summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-10-28 08:37:59 +0100
committerGitHub <noreply@github.com>2019-10-28 08:37:59 +0100
commit63c5cd7eb89c5e7d24465b910eb6015b344c3f5f (patch)
tree0da485fc1328f59d10b8c0a04074db3e729c2fa5 /scene
parent826ffc26c985db7cbaaa3fef4c60af8fef514f0c (diff)
parente53e1c566ac9e2e9b829f1cdbfd5d27537053cd1 (diff)
Merge pull request #33104 from qarmin/fix_some_crashes
Fix some crashes and using null pointers
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/navigation_mesh.h2
-rw-r--r--scene/resources/material.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h
index 8467f80f0e..d5de653e40 100644
--- a/scene/3d/navigation_mesh.h
+++ b/scene/3d/navigation_mesh.h
@@ -124,7 +124,7 @@ public:
void set_collision_mask_bit(int p_bit, bool p_value);
bool get_collision_mask_bit(int p_bit) const;
- void set_source_geometry_mode(int p_source_mode);
+ void set_source_geometry_mode(int p_geometry_mode);
int get_source_geometry_mode() const;
void set_source_group_name(StringName p_group_name);
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 10bea5f64c..b10db9ee61 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -1776,6 +1776,7 @@ SpatialMaterial::TextureChannel SpatialMaterial::get_roughness_texture_channel()
void SpatialMaterial::set_ao_texture_channel(TextureChannel p_channel) {
+ ERR_FAIL_INDEX(p_channel, 5);
ao_texture_channel = p_channel;
VS::get_singleton()->material_set_param(_get_material(), shader_names->ao_texture_channel, _get_texture_mask(p_channel));
}
@@ -1786,6 +1787,7 @@ SpatialMaterial::TextureChannel SpatialMaterial::get_ao_texture_channel() const
void SpatialMaterial::set_refraction_texture_channel(TextureChannel p_channel) {
+ ERR_FAIL_INDEX(p_channel, 5);
refraction_texture_channel = p_channel;
VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction_texture_channel, _get_texture_mask(p_channel));
}