From 52ee682a4891660fdfceb2c4ed6ec2afab1685b6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 2 Nov 2019 19:09:15 +0100 Subject: [PATCH] =?UTF-8?q?Bug=202617:=20Berechnung=20von=20=C3=9Cberladun?= =?UTF-8?q?g=20berechnet=20Flotten=20korrekt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/move.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/move.c b/src/move.c index 0fc6f6411..e444ead56 100644 --- a/src/move.c +++ b/src/move.c @@ -501,7 +501,7 @@ static double overload(const region * r, ship * sh) double ovl; getshipweight(sh, &n, &p); - ovl = n / (double)sh->type->cargo; + ovl = n / (double)(sh->type->cargo * sh->number); if (mcabins) { ovl = fmax(ovl, p / (double)mcabins); } @@ -746,7 +746,7 @@ double damage_overload(double overload) } /* message to all factions in ship, start from firstu, end before lastu (may be NULL) */ -static void msg_to_ship_inmates(ship *sh, unit **firstu, unit **lastu, message *msg) { +static void msg_to_passengers(ship *sh, unit **firstu, unit **lastu, message *msg) { unit *u, *shipfirst = NULL; for (u = *firstu; u != *lastu; u = u->next) { if (u->ship == sh) { @@ -836,19 +836,19 @@ static void drifting_ships(region * r) if (rnext && firstu) { message *msg = msg_message("ship_drift", "ship dir", sh, dir); - msg_to_ship_inmates(sh, &firstu, &lastu, msg); + msg_to_passengers(sh, &firstu, &lastu, msg); } fset(sh, SF_DRIFTED); if (ovl >= overload_start()) { damage_ship(sh, damage_overload(ovl)); - msg_to_ship_inmates(sh, &firstu, &lastu, msg_message("massive_overload", "ship", sh)); + msg_to_passengers(sh, &firstu, &lastu, msg_message("massive_overload", "ship", sh)); } else { damage_ship(sh, damage_drift); } if (sh->damage >= sh->size * DAMAGE_SCALE) { - msg_to_ship_inmates(sh, &firstu, &lastu, msg_message("shipsink", "ship", sh)); + msg_to_passengers(sh, &firstu, &lastu, msg_message("shipsink", "ship", sh)); sink_ship(sh); remove_ship(shp, sh); }