diff --git a/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp b/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp index c82f1b4e5..5d979078e 100644 --- a/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp +++ b/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp @@ -258,6 +258,8 @@ void CharacterSkeleton2D::add_model_visual_entry(Ref vis, Refget_bone(); + ERR_FAIL_INDEX(target_bone_idx, _entries.size()); + Vector> &entries = _entries.write[target_bone_idx]; for (int i = 0; i < entries.size(); ++i) { diff --git a/modules/entity_spell_system/skeleton/character_skeleton_3d.cpp b/modules/entity_spell_system/skeleton/character_skeleton_3d.cpp index de7e82ed2..c5b5e77f9 100644 --- a/modules/entity_spell_system/skeleton/character_skeleton_3d.cpp +++ b/modules/entity_spell_system/skeleton/character_skeleton_3d.cpp @@ -298,6 +298,8 @@ void CharacterSkeleton3D::add_model_visual_entry(Ref vis, Refget_bone(); + ERR_FAIL_INDEX(target_bone_idx, _entries.size()); + Vector> &entries = _entries.write[target_bone_idx]; for (int i = 0; i < entries.size(); ++i) {