Merge pull request #55018 from kodiwills/add-error-macros-for-set_modification_count

add negative number validation for set_modification_count
This commit is contained in:
Rémi Verschelde 2021-11-17 08:48:19 +01:00 committed by GitHub
commit 08eb8c9fc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -195,6 +195,7 @@ void SkeletonModificationStack2D::set_modification(int p_mod_idx, Ref<SkeletonMo
}
void SkeletonModificationStack2D::set_modification_count(int p_count) {
ERR_FAIL_COND_MSG(p_count < 0, "Modification count cannot be less than zero.");
modifications.resize(p_count);
notify_property_list_changed();

View file

@ -149,6 +149,7 @@ void SkeletonModificationStack3D::set_modification(int p_mod_idx, Ref<SkeletonMo
}
void SkeletonModificationStack3D::set_modification_count(int p_count) {
ERR_FAIL_COND_MSG(p_count < 0, "Modification count cannot be less than zero.");
modifications.resize(p_count);
notify_property_list_changed();
}