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

Fix some issues found by cppcheck.

This commit is contained in:
bruvzg
2022-04-05 13:40:26 +03:00
parent 72407a9cfb
commit f851c4aa33
163 changed files with 776 additions and 767 deletions

View File

@@ -270,7 +270,7 @@ void EditorInspectorPluginMaterial::_undo_redo_inspector_callback(Object *p_undo
Texture2D *texture = Object::cast_to<Texture2D>(p_new_value);
if (texture) {
if (p_property == "roughness_texture") {
if (base_material->get_texture(StandardMaterial3D::TEXTURE_ROUGHNESS).is_null() && texture) {
if (base_material->get_texture(StandardMaterial3D::TEXTURE_ROUGHNESS).is_null()) {
undo_redo->add_do_property(p_edited, "roughness", 1.0);
bool valid = false;
@@ -280,7 +280,7 @@ void EditorInspectorPluginMaterial::_undo_redo_inspector_callback(Object *p_undo
}
}
} else if (p_property == "metallic_texture") {
if (base_material->get_texture(StandardMaterial3D::TEXTURE_METALLIC).is_null() && texture) {
if (base_material->get_texture(StandardMaterial3D::TEXTURE_METALLIC).is_null()) {
undo_redo->add_do_property(p_edited, "metallic", 1.0);
bool valid = false;