From af38320300832f93bfa429d5300fbe0273253912 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Thu, 6 Aug 2015 20:52:48 -0500 Subject: [PATCH 1/2] warning C4706: assignment within conditional expression --- Engine/source/forest/forestWindEmitter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine/source/forest/forestWindEmitter.cpp b/Engine/source/forest/forestWindEmitter.cpp index 67dc3fc12..eaab18665 100644 --- a/Engine/source/forest/forestWindEmitter.cpp +++ b/Engine/source/forest/forestWindEmitter.cpp @@ -522,8 +522,9 @@ void ForestWindEmitter::_renderEmitterInfo( ObjectRenderInst *ri, SceneRenderSta // If the camera is close to the sphere, shrink the sphere so it remains visible. GameConnection* gc = GameConnection::getConnectionToServer(); GameBase* gb; - if ( gc && (gb = gc->getCameraObject()) ) + if (gc && (gc->getCameraObject())) { + gb = gc->getCameraObject(); F32 camDist = (gb->getPosition() - getPosition()).len(); if ( camDist < mWindRadius ) useRadius = camDist; From c100d7f932d3d37e3b2bbf80f643b9247599d488 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Thu, 6 Aug 2015 21:56:46 -0500 Subject: [PATCH 2/2] suggested revision --- Engine/source/forest/forestWindEmitter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Engine/source/forest/forestWindEmitter.cpp b/Engine/source/forest/forestWindEmitter.cpp index eaab18665..20ad621cf 100644 --- a/Engine/source/forest/forestWindEmitter.cpp +++ b/Engine/source/forest/forestWindEmitter.cpp @@ -521,10 +521,9 @@ void ForestWindEmitter::_renderEmitterInfo( ObjectRenderInst *ri, SceneRenderSta { // If the camera is close to the sphere, shrink the sphere so it remains visible. GameConnection* gc = GameConnection::getConnectionToServer(); - GameBase* gb; - if (gc && (gc->getCameraObject())) + GameBase *gb = gc ? gc->getCameraObject() : NULL; + if (gb) { - gb = gc->getCameraObject(); F32 camDist = (gb->getPosition() - getPosition()).len(); if ( camDist < mWindRadius ) useRadius = camDist;