summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-17 08:48:19 +0100
committerGitHub <noreply@github.com>2021-11-17 08:48:19 +0100
commit08eb8c9fc355260d66b6d1a8cd854e26102d3eed (patch)
treed1b4103db7912a7f5fc626fc4116fa5d4aa939df /scene
parentc30aa372cad400c08f9f95e90cd68ffac5b9187c (diff)
parentbdcd98c6ce568a63589f350133113a2d06c17c46 (diff)
Merge pull request #55018 from kodiwills/add-error-macros-for-`set_modification_count`
add negative number validation for set_modification_count
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/skeleton_modification_stack_2d.cpp1
-rw-r--r--scene/resources/skeleton_modification_stack_3d.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/skeleton_modification_stack_2d.cpp b/scene/resources/skeleton_modification_stack_2d.cpp
index db9fe62b4d..25c3e9d2ef 100644
--- a/scene/resources/skeleton_modification_stack_2d.cpp
+++ b/scene/resources/skeleton_modification_stack_2d.cpp
@@ -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();
diff --git a/scene/resources/skeleton_modification_stack_3d.cpp b/scene/resources/skeleton_modification_stack_3d.cpp
index c03210cf48..301811f0b6 100644
--- a/scene/resources/skeleton_modification_stack_3d.cpp
+++ b/scene/resources/skeleton_modification_stack_3d.cpp
@@ -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();
}