summaryrefslogtreecommitdiff
path: root/scene/3d/interpolated_camera.cpp
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2017-09-06 23:50:18 +0200
committerHein-Pieter van Braam <hp@tmm.cx>2017-09-08 14:59:15 +0200
commit8230bf0a2f39f0849b670d26067207c45edcca1a (patch)
tree42f598d11fab7f1449d0cace0f991f546bd72e72 /scene/3d/interpolated_camera.cpp
parentd1cb73b47a17de830d9474026ffa7b3587cfbc68 (diff)
Remove assignment and declarations in if statements
After discussing with @reduz and @akien-mga it was decided that we do not allow assignments or declarations in if statements. This PR removes the instances of this I could find by automated means.
Diffstat (limited to 'scene/3d/interpolated_camera.cpp')
-rw-r--r--scene/3d/interpolated_camera.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp
index 157ae42571..0f281b694d 100644
--- a/scene/3d/interpolated_camera.cpp
+++ b/scene/3d/interpolated_camera.cpp
@@ -55,8 +55,8 @@ void InterpolatedCamera::_notification(int p_what) {
Transform local_transform = get_global_transform();
local_transform = local_transform.interpolate_with(target_xform, delta);
set_global_transform(local_transform);
-
- if (Camera *cam = Object::cast_to<Camera>(node)) {
+ Camera *cam = Object::cast_to<Camera>(node);
+ if (cam) {
if (cam->get_projection() == get_projection()) {