← Back to team overview

widelands-dev team mailing list archive

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

 

Notabilis has proposed merging lp:~widelands-dev/widelands/bug-supply into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1639444 in widelands: "Workers with wares inside ships can crash the game"
  https://bugs.launchpad.net/widelands/+bug/1639444

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-supply/+merge/312421

Fixes a crash when the ware carried by a worker on a ship is requested.

See also the other branch for a crashing regression test that is fixed by this branch:
https://code.launchpad.net/~widelands-dev/widelands/feature-test-supply-crash
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-supply into lp:widelands.
=== modified file 'src/economy/ware_instance.cc'
--- src/economy/ware_instance.cc	2016-08-04 15:49:05 +0000
+++ src/economy/ware_instance.cc	2016-12-03 23:25:00 +0000
@@ -125,7 +125,11 @@
 	if (is_a(Ship, loc)) {
 		return SupplyProviders::kShip;
 	}
-
+	if (upcast(Worker, worker, loc)) {
+		if (worker->is_shipping()) {
+			return SupplyProviders::kShip;
+		}
+	}
 	return SupplyProviders::kFlagOrRoad;
 }
 


Follow ups