← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/ship_path_dbg into lp:widelands

 

TiborB has proposed merging lp:~widelands-dev/widelands/ship_path_dbg into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ship_path_dbg/+merge/318316

Modifying content of ship DBG window - to list coords of full path...
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ship_path_dbg into lp:widelands.
=== modified file 'src/logic/map_objects/bob.cc'
--- src/logic/map_objects/bob.cc	2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/bob.cc	2017-02-25 20:09:13 +0000
@@ -940,9 +940,11 @@
 			molog("** Path length: %lu\n", static_cast<long unsigned int>(nr_steps));
 			molog("** Start: (%i, %i)\n", path.get_start().x, path.get_start().y);
 			molog("** End: (%i, %i)\n", path.get_end().x, path.get_end().y);
-			for (Path::StepVector::size_type j = 0; j < nr_steps; ++j)
-				molog("** Step %lu/%lu: %i\n", static_cast<long unsigned int>(j + 1),
-				      static_cast<long unsigned int>(nr_steps), path[j]);
+			// Printing all coordinates of the path
+			CoordPath coordpath(egbase.map(), path);
+			for (const Coords& coords : coordpath.get_coords()) {
+				molog("*  (%i, %i)\n", coords.x, coords.y);
+			}
 		}
 		molog("* route: %p\n", stack_[i].route);
 


Follow ups