diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2017-09-12 11:57:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-12 11:57:49 +0200 |
| commit | cf941fdc357791a93bd9ab9eaf16898e0c218ff3 (patch) | |
| tree | 546d046bffd826359c85240ae4562ef5df734e86 /scene/3d/bone_attachment.cpp | |
| parent | 84ccda4e1d6f9a63b689167887f7d329cdc5dffa (diff) | |
| parent | 8230bf0a2f39f0849b670d26067207c45edcca1a (diff) | |
Merge pull request #11026 from hpvb/fix-assign-in-if
Remove assignment and declarations in if statements
Diffstat (limited to 'scene/3d/bone_attachment.cpp')
| -rw-r--r-- | scene/3d/bone_attachment.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index e1a5329fb0..2580b645e2 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -71,7 +71,8 @@ void BoneAttachment::_get_property_list(List<PropertyInfo> *p_list) const { void BoneAttachment::_check_bind() { - if (Skeleton *sk = Object::cast_to<Skeleton>(get_parent())) { + Skeleton *sk = Object::cast_to<Skeleton>(get_parent()); + if (sk) { int idx = sk->find_bone(bone_name); if (idx != -1) { @@ -86,7 +87,8 @@ void BoneAttachment::_check_unbind() { if (bound) { - if (Skeleton *sk = Object::cast_to<Skeleton>(get_parent())) { + Skeleton *sk = Object::cast_to<Skeleton>(get_parent()); + if (sk) { int idx = sk->find_bone(bone_name); if (idx != -1) { |