Esempio n. 1
0
	int SetPos( int nx, int ny ) 
	{
		int result = 0;
		if ( Passable( nx, ny ) == 1 )
		{
			#ifdef USE_PATHER
				float totalCost;
				if ( showConsidered )
					pather->Reset();
					
				result = pather->Solve( XYToNode( playerX, playerY ), XYToNode( nx, ny ), &path, &totalCost );

				if ( result == MicroPather::SOLVED ) {
					playerX = nx;
					playerY = ny;
				}
				printf( "Pather returned %d\n", result );

			#else
				playerX = nx;
				playerY = ny;
			#endif
		}
		return result;
	}