← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1542238-log into lp:widelands

 

TiborB has proposed merging lp:~widelands-dev/widelands/bug-1542238-log into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1542238 in widelands: "assertion failed within unset_position()"
  https://bugs.launchpad.net/widelands/+bug/1542238

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1542238-log/+merge/285237

This only ads one log() with some details about the immovable that does not match
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1542238-log into lp:widelands.
=== modified file 'src/logic/map_objects/immovable.cc'
--- src/logic/map_objects/immovable.cc	2016-01-29 08:37:22 +0000
+++ src/logic/map_objects/immovable.cc	2016-02-05 20:31:08 +0000
@@ -116,6 +116,15 @@
 	Map & map = egbase.map();
 	FCoords const f = map.get_fcoords(c);
 
+	// this is to help to debug failing assertion below (see bug 1542238)
+	if (f.field->immovable != this){
+		printf (" Internal error: Immovable at %3dx%3d does not match: is %s but %s was expected.\n",
+		c.x,
+		c.y,
+		(f.field->immovable) ? f.field->immovable->descr().name().c_str() : "None",
+		descr().name().c_str());
+	}
+
 	assert(f.field->immovable == this);
 
 	f.field->immovable = nullptr;


Follow ups