mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-11 21:31:10 +01:00
Fix potential crash.
This commit is contained in:
parent
3e97039c99
commit
cc52a10ac7
@ -258,6 +258,8 @@ void CharacterSkeleton2D::add_model_visual_entry(Ref<ModelVisual> vis, Ref<Model
|
|||||||
|
|
||||||
int target_bone_idx = ive->get_bone();
|
int target_bone_idx = ive->get_bone();
|
||||||
|
|
||||||
|
ERR_FAIL_INDEX(target_bone_idx, _entries.size());
|
||||||
|
|
||||||
Vector<Ref<SkeletonModelEntry>> &entries = _entries.write[target_bone_idx];
|
Vector<Ref<SkeletonModelEntry>> &entries = _entries.write[target_bone_idx];
|
||||||
|
|
||||||
for (int i = 0; i < entries.size(); ++i) {
|
for (int i = 0; i < entries.size(); ++i) {
|
||||||
|
@ -298,6 +298,8 @@ void CharacterSkeleton3D::add_model_visual_entry(Ref<ModelVisual> vis, Ref<Model
|
|||||||
|
|
||||||
int target_bone_idx = ive->get_bone();
|
int target_bone_idx = ive->get_bone();
|
||||||
|
|
||||||
|
ERR_FAIL_INDEX(target_bone_idx, _entries.size());
|
||||||
|
|
||||||
Vector<Ref<SkeletonModelEntry>> &entries = _entries.write[target_bone_idx];
|
Vector<Ref<SkeletonModelEntry>> &entries = _entries.write[target_bone_idx];
|
||||||
|
|
||||||
for (int i = 0; i < entries.size(); ++i) {
|
for (int i = 0; i < entries.size(); ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user