Index: src/economy.cpp =================================================================== --- src/economy.cpp (revision 19125) +++ src/economy.cpp (working copy) @@ -1351,8 +1351,33 @@ /* Each platform tile is worth 2 rail vehicles. */ int overhang = Train::From(v)->tcache.cached_total_length - st->GetPlatformLength(v->tile) * TILE_SIZE; if (overhang > 0) { - unloading_time <<= 1; - unloading_time += (overhang * unloading_time) / 8; + + /* Get cargo type of first wagon */ + CargoID cargo_type = CT_INVALID; + for (Vehicle *u = v;u != NULL; u = u->Next()){ + if (!Train::From(u)->IsWagon()) continue; + cargo_type = u->cargo_type; break; + } + + int penalty = 8; + switch (cargo_type) { + case CT_PASSENGERS: penalty = 16; break; + case CT_COAL: penalty = 2; break; + case CT_OIL: penalty = 2; break; + case CT_IRON_ORE: penalty = 2; break; + } + /* Only allow lower penalty for trains carrying the same cargo type in all wagons + * else give max penalty (this will do :))*/ + for (Vehicle *u = v; u != NULL; u = u->Next()){ + if (!Train::From(u)->IsWagon()) continue; + if (cargo_type != u->cargo_type) { + penalty = 16; + break; + } + } + /* wagons on the platform are not penelized, only the ones hanging over*/ + int extra_platforms_lengths = (overhang / (st->GetPlatformLength(v->tile) * TILE_SIZE)) + 1; + unloading_time += unloading_time * extra_platforms_lengths * penalty; } }