Skip to content

Commit

Permalink
Fix wrong return value in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Jun 18, 2023
1 parent bd58988 commit e5c875e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions meshers/blocky/types/voxel_blocky_type_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,20 +250,20 @@ static bool parse_attribute_value(
StringName value_name = vv;

Ref<VoxelBlockyAttribute> attrib = type.get_attribute_by_name(attrib_name);
ERR_FAIL_COND_V_MSG(attrib.is_null(), -1,
ERR_FAIL_COND_V_MSG(attrib.is_null(), false,
String("{0} type '{1}' has no attribute named '{2}'")
.format(varray(VoxelBlockyType::get_class_static(), type.get_unique_name(), attrib_name)));

int attrib_value = attrib->get_value_from_name(value_name);
ERR_FAIL_COND_V_MSG(attrib_value == -1, -1,
ERR_FAIL_COND_V_MSG(attrib_value == -1, false,
String("{0} ('{1}') has no value with name '{2}'")
.format(varray(attrib->get_class(), attrib->get_attribute_name(), value_name)));

out_attrib_value = attrib_value;

} else if (vv.get_type() == Variant::INT) {
const int raw_value = vv;
ERR_FAIL_COND_V_MSG(raw_value >= 0, -1, "Attribute integer value cannot be negative.");
ERR_FAIL_COND_V_MSG(raw_value >= 0, false, "Attribute integer value cannot be negative.");
out_attrib_value = raw_value;

} else if (vv.get_type() == Variant::BOOL) {
Expand Down

0 comments on commit e5c875e

Please sign in to comment.