Kolja Strohm 3 rokov pred
rodič
commit
e2ae7bea5e
2 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 1 1
      FactoryCraft/Game.cpp
  2. 1 1
      FactoryCraft/WorldUpdate.cpp

+ 1 - 1
FactoryCraft/Game.cpp

@@ -64,7 +64,7 @@ void GameClient::sendWorldUpdate( WorldUpdate* update )
             int index = 0;
             for( auto update2 : updateQueue )
             {
-                int dist2 = update2->distanceTo( pohen world is s.x, pos.y );
+                int dist2 = update2->distanceTo( pos.x, pos.y );
                 if( dist2 >= dist )
                     break;
                 index++;

+ 1 - 1
FactoryCraft/WorldUpdate.cpp

@@ -36,7 +36,7 @@ int WorldUpdate::distanceTo( int x, int y ) const
         xDist = 0;
     if( y >= minAffected.y && y <= maxAffected.y )
         yDist = 0;
-    return xDist * xDist + yDist * yDist;
+    return sqrt( xDist * xDist + yDist * yDist );
 }