summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-11-01 12:15:33 +0000
committeryexo <yexo@openttd.org>2011-11-01 12:15:33 +0000
commita95e7982f051201ee0cae85a0098377dbe6bcf9c (patch)
tree794438e0c6355db5024017fbd476f6c18593e428 /src
parent1d1c9f44a12b7d11dfedffc70fa1e5be1f64de9b (diff)
downloadopenttd-a95e7982f051201ee0cae85a0098377dbe6bcf9c.tar.xz
(svn r23078) -Fix (r23077): default ships carrying passengers and oil were suddenly only able to carry coal
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 56d49e1b9..0c1ca3fbe 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -8015,6 +8015,12 @@ static void CalculateRefitMasks()
only_defaultcargo = (ei->refit_mask == 0);
}
+ /* Clear refit_mask for not refittable ships */
+ if (e->type == VEH_SHIP && !e->u.ship.old_refittable) {
+ ei->refit_mask = 0;
+ only_defaultcargo = true;
+ }
+
/* Ensure that the vehicle is either not refittable, or that the default cargo is one of the refittable cargos.
* Note: Vehicles refittable to no cargo are handle differently to vehicle refittable to a single cargo. The latter might have subtypes. */
if (!only_defaultcargo && ei->cargo_type != CT_INVALID && !HasBit(ei->refit_mask, ei->cargo_type)) {
@@ -8025,9 +8031,6 @@ static void CalculateRefitMasks()
* cargo type. Finally disable the vehicle, if there is still no cargo. */
if (ei->cargo_type == CT_INVALID && ei->refit_mask != 0) ei->cargo_type = (CargoID)FindFirstBit(ei->refit_mask);
if (ei->cargo_type == CT_INVALID) ei->climates = 0;
-
- /* Clear refit_mask for not refittable ships */
- if (e->type == VEH_SHIP && !e->u.ship.old_refittable) ei->refit_mask = 0;
}
}