Merge branch 'infrastructure_sharing-sx' into jgrpp

# Conflicts:
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/table/company_settings.ini
This commit is contained in:
Jonathan G Rennison
2016-02-13 22:14:47 +00:00
6 changed files with 53 additions and 4 deletions

View File

@@ -719,7 +719,8 @@ static CommandCost CmdBuildRailWagon(TileIndex tile, DoCommandFlag flags, const
w->IsFreeWagon() && ///< A free wagon chain
w->engine_type == e->index && ///< Same type
w->First() != v && ///< Don't connect to ourself
!(w->vehstatus & VS_CRASHED)) { ///< Not crashed/flooded
!(w->vehstatus & VS_CRASHED) && ///< Not crashed/flooded
w->owner == v->owner) { ///< Same owner
DoCommand(0, v->index | 1 << 20, w->Last()->index, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
break;
}
@@ -735,7 +736,8 @@ static void NormalizeTrainVehInDepot(const Train *u)
const Train *v;
FOR_ALL_TRAINS(v) {
if (v->IsFreeWagon() && v->tile == u->tile &&
v->track == TRACK_BIT_DEPOT) {
v->track == TRACK_BIT_DEPOT &&
v->owner == u->owner) {
if (DoCommand(0, v->index | 1 << 20, u->index, DC_EXEC,
CMD_MOVE_RAIL_VEHICLE).Failed())
break;
@@ -874,7 +876,7 @@ static Train *FindGoodVehiclePos(const Train *src)
Train *dst;
FOR_ALL_TRAINS(dst) {
if (dst->IsFreeWagon() && dst->tile == tile && !(dst->vehstatus & VS_CRASHED)) {
if (dst->IsFreeWagon() && dst->tile == tile && !(dst->vehstatus & VS_CRASHED) && dst->owner == src->owner) {
/* check so all vehicles in the line have the same engine. */
Train *t = dst;
while (t->engine_type == eng) {