Fix some code style

dev-buzzingcars
krzys-h 2016-12-27 15:54:52 +01:00
parent f33ffaf18b
commit 17511ddb6a
2 changed files with 6 additions and 10 deletions

View File

@ -1093,19 +1093,15 @@ CObject* CTaskGoto::SearchTarget(Math::Vector pos, float margin)
* See issue #732 * See issue #732
*/ */
CObject *pBest; CObject* pBest = nullptr;
Math::Vector oPos; float min = 1000000.0f;
float dist, min;
pBest = 0;
min = 1000000.0f;
for ( CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects() ) for ( CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects() )
{ {
if ( !pObj->GetActive() ) continue; if ( !pObj->GetActive() ) continue;
if ( IsObjectBeingTransported(pObj) ) continue; // object transtorted? if ( IsObjectBeingTransported(pObj) ) continue; // object transtorted?
oPos = pObj->GetPosition(); Math::Vector oPos = pObj->GetPosition();
dist = Math::DistanceProjected(pos, oPos); float dist = Math::DistanceProjected(pos, oPos);
if ( dist <= margin && dist <= min ) if ( dist <= margin && dist <= min )
{ {

View File

@ -19,11 +19,11 @@
#include "ui/debug_menu.h" #include "ui/debug_menu.h"
#include "app/app.h"
#include "common/event.h" #include "common/event.h"
#include "common/stringutils.h" #include "common/stringutils.h"
#include "app/app.h"
#include "graphics/engine/lightning.h" #include "graphics/engine/lightning.h"
#include "graphics/engine/terrain.h" #include "graphics/engine/terrain.h"