← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1674243-crash_with_save_game into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1674243-crash_with_save_game into lp:widelands.

Commit message:
Removed line in the game renderer that could make field owner == nullptr depending on player vision. This was causing crashes with the road program, which no longer new which texture to pick.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1674243 in widelands: "road_program: Assertion `start.owner != nullptr || end.owner != nullptr' failed."
  https://bugs.launchpad.net/widelands/+bug/1674243

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1674243-crash_with_save_game/+merge/324301
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1674243-crash_with_save_game into lp:widelands.
=== modified file 'src/graphic/game_renderer.cc'
--- src/graphic/game_renderer.cc	2017-01-25 18:55:59 +0000
+++ src/graphic/game_renderer.cc	2017-05-19 07:28:26 +0000
@@ -128,7 +128,7 @@
 	}
 }
 
-void draw_objets_for_formerly_visible_field(const FieldsToDraw::Field& field,
+void draw_objects_for_formerly_visible_field(const FieldsToDraw::Field& field,
                                             const Player::Field& player_field,
                                             const float zoom,
                                             RenderTarget* dst) {
@@ -246,7 +246,7 @@
 			const Map& map = egbase.map();
 			const Player::Field& player_field =
 			   player->fields()[map.get_index(field.fcoords, map.get_width())];
-			draw_objets_for_formerly_visible_field(field, player_field, zoom, dst);
+			draw_objects_for_formerly_visible_field(field, player_field, zoom, dst);
 		}
 
 		const FieldOverlayManager& overlay_manager = egbase.get_ibase()->field_overlay_manager();
@@ -419,7 +419,6 @@
 				f.roads = pf.roads;
 				f.vision = pf.vision;
 				if (pf.vision == 1) {
-					f.owner = pf.owner != 0 ? &egbase.player(owned_by) : nullptr;
 					f.is_border = pf.border;
 				}
 			}


Follow ups