# HG changeset patch # User yexo # Date 1320149733 0 # Node ID 2eacf17b9ebc977e836ddbe16af0c5bd526b9e95 # Parent b9d050ddad0f1517150ab123871d916d83d63fd0 (svn r23078) -Fix (r23077): default ships carrying passengers and oil were suddenly only able to carry coal diff --git a/src/newgrf.cpp b/src/newgrf.cpp --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -8015,6 +8015,12 @@ 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 @@ * 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; } }