← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1489295-mine-is-exhausted into lp:widelands

 

Toni Förster has proposed merging lp:~widelands-dev/widelands/bug-1489295-mine-is-exhausted into lp:widelands.

Commit message:
when main vein is exhausted, don't show tooltip for missing food

Requested reviews:
  hessenfarmer (stephan-lutz)
Related bugs:
  Bug #1489295 in widelands: "ware x is missing and mine exhausted"
  https://bugs.launchpad.net/widelands/+bug/1489295

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1489295-mine-is-exhausted/+merge/366727

I tested this with barbarians and found no wrong tooltips. Needs extensive testing though.
-- 
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1489295-mine-is-exhausted.
=== modified file 'src/logic/map_objects/tribes/production_program.cc'
--- src/logic/map_objects/tribes/production_program.cc	2019-04-30 15:04:35 +0000
+++ src/logic/map_objects/tribes/production_program.cc	2019-04-30 18:09:57 +0000
@@ -915,8 +915,9 @@
 		   (boost::format(_("Did not start %1$s because %2$s")) % ps.top_state().program->descname() %
 		    is_missing_string)
 		      .str();
-
-		ps.set_production_result(result_string);
+		if ( ps.production_result() != ps.descr().out_of_resource_heading()) {
+			ps.set_production_result(result_string);
+		}
 		return ps.program_end(game, ProgramResult::kFailed);
 	} else {  //  we fulfilled all consumption requirements
 		for (size_t i = 0; i < inputqueues.size(); ++i) {


Follow ups