From 3667cc6e1f13eb53b8eed0b7880cfccc1f27afee Mon Sep 17 00:00:00 2001 From: Justin Fraize Date: Thu, 12 Feb 2015 21:00:12 -0800 Subject: [PATCH] Cleaned up CCAction.cpp *Fixed tab/space issue. *Removed unneeded if/else block. *Added explicit braces around if block. --- cocos/2d/CCAction.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cocos/2d/CCAction.cpp b/cocos/2d/CCAction.cpp index 488fa790a2..d1392d5e32 100644 --- a/cocos/2d/CCAction.cpp +++ b/cocos/2d/CCAction.cpp @@ -201,16 +201,8 @@ bool Follow::initWithTarget(Node *followedNode, const Rect& rect/* = Rect::ZERO* followedNode->retain(); _followedNode = followedNode; - _worldRect = rect; - if (rect.equals(Rect::ZERO)) - { - _boundarySet = false; - } - else - { - _boundarySet = true; - } - + _worldRect = rect; + _boundarySet = !rect.equals(Rect::ZERO); _boundaryFullyCovered = false; Size winSize = Director::getInstance()->getWinSize(); @@ -254,7 +246,9 @@ void Follow::step(float dt) { // whole map fits inside a single screen, no need to modify the position - unless map boundaries are increased if(_boundaryFullyCovered) + { return; + } Vec2 tempPos = _halfScreenSize - _followedNode->getPosition();