1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

(svn r27585) -Fix [FS#6437]: Enforce a non-zero load amount for all vehicles, so that vehicles can process their cargo reservations.

This commit is contained in:
frosch
2016-05-29 13:35:17 +00:00
parent dac94c7cbc
commit b0c56f3432

View File

@@ -1317,7 +1317,8 @@ static uint GetLoadAmount(Vehicle *v)
/* Scale load amount the same as capacity */ /* Scale load amount the same as capacity */
if (HasBit(e->info.misc_flags, EF_NO_DEFAULT_CARGO_MULTIPLIER) && !air_mail) load_amount = CeilDiv(load_amount * CargoSpec::Get(v->cargo_type)->multiplier, 0x100); if (HasBit(e->info.misc_flags, EF_NO_DEFAULT_CARGO_MULTIPLIER) && !air_mail) load_amount = CeilDiv(load_amount * CargoSpec::Get(v->cargo_type)->multiplier, 0x100);
return load_amount; /* Zero load amount breaks a lot of things. */
return max(1u, load_amount);
} }
/** /**