summaryrefslogtreecommitdiff
path: root/scene/resources/skeleton_modification_stack_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/skeleton_modification_stack_3d.cpp')
-rw-r--r--scene/resources/skeleton_modification_stack_3d.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/resources/skeleton_modification_stack_3d.cpp b/scene/resources/skeleton_modification_stack_3d.cpp
index a724b732b9..e5b7771251 100644
--- a/scene/resources/skeleton_modification_stack_3d.cpp
+++ b/scene/resources/skeleton_modification_stack_3d.cpp
@@ -125,6 +125,7 @@ Ref<SkeletonModification3D> SkeletonModificationStack3D::get_modification(int p_
}
void SkeletonModificationStack3D::add_modification(Ref<SkeletonModification3D> p_mod) {
+ ERR_FAIL_NULL(p_mod);
p_mod->_setup_modification(this);
modifications.push_back(p_mod);
}
@@ -132,7 +133,7 @@ void SkeletonModificationStack3D::add_modification(Ref<SkeletonModification3D> p
void SkeletonModificationStack3D::delete_modification(int p_mod_idx) {
const int modifications_size = modifications.size();
ERR_FAIL_INDEX(p_mod_idx, modifications_size);
- modifications.remove(p_mod_idx);
+ modifications.remove_at(p_mod_idx);
}
void SkeletonModificationStack3D::set_modification(int p_mod_idx, Ref<SkeletonModification3D> p_mod) {
@@ -140,7 +141,7 @@ void SkeletonModificationStack3D::set_modification(int p_mod_idx, Ref<SkeletonMo
ERR_FAIL_INDEX(p_mod_idx, modifications_size);
if (p_mod == nullptr) {
- modifications.remove(p_mod_idx);
+ modifications.remove_at(p_mod_idx);
} else {
p_mod->_setup_modification(this);
modifications[p_mod_idx] = p_mod;
@@ -148,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();
}