← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~ab-tools/widelands/ships-devisionbyzero into lp:widelands

 

Andreas Breitschopp has proposed merging lp:~ab-tools/widelands/ships-devisionbyzero into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #963963 in widelands: "Game crashes when ship construction site cannot be cleared for a new ship"
  https://bugs.launchpad.net/widelands/+bug/963963

For more details, see:
https://code.launchpad.net/~ab-tools/widelands/ships-devisionbyzero/+merge/108948
-- 
https://code.launchpad.net/~ab-tools/widelands/ships-devisionbyzero/+merge/108948
Your team Widelands Developers is requested to review the proposed merge of lp:~ab-tools/widelands/ships-devisionbyzero into lp:widelands.
=== modified file 'src/logic/ship.cc'
--- src/logic/ship.cc	2012-02-15 21:25:34 +0000
+++ src/logic/ship.cc	2012-06-06 14:04:30 +0000
@@ -314,6 +314,11 @@
 			totalprob += prob[dir];
 		}
 
+		if (totalprob == 0) {
+			start_task_idle(game, descr().main_animation(), 1500);
+			return;
+		}
+
 		unsigned int rnd = game.logic_rand() % totalprob;
 		Direction dir = 0;
 		while (rnd >= prob[dir]) {


Follow ups