# HG changeset patch # User bjarni # Date 1148420958 0 # Node ID 580ff4e6a49e1953aa14c124e834790109d77808 # Parent ebe5f95d8917a0991af897cb5619680981b86378 (svn r4967) -Fix: [clone vehicles] a cloned train engine heads the same way as the original (pointed out by bobingabout) [autoreplace] the same applies to autoreplaced trains if the engine is a single unit (not dualheaded or articulated) diff -r ebe5f95d8917 -r 580ff4e6a49e vehicle.c --- a/vehicle.c Tue May 23 20:59:01 2006 +0000 +++ b/vehicle.c Tue May 23 21:49:18 2006 +0000 @@ -1550,6 +1550,9 @@ DoCommand(0, w->index, v->cargo_type, flags, CMD_REFIT_VEH(v->type)); } } + if (v->type == VEH_Train && HASBIT(v->u.rail.flags, VRF_REVERSE_DIRECTION)) { + SETBIT(w->u.rail.flags, VRF_REVERSE_DIRECTION); + } if (v->type == VEH_Train && !IsFrontEngine(v)) { // this s a train car @@ -1641,7 +1644,10 @@ if (!CmdFailed(temp_cost)) cost += temp_cost; } } - + if (new_v->type == VEH_Train && HASBIT(old_v->u.rail.flags, VRF_REVERSE_DIRECTION) && !IsMultiheaded(new_v) && !(new_v->next != NULL && IsArticulatedPart(new_v->next))) { + // we are autorenewing to a single engine, so we will turn it as the old one was turned as well + SETBIT(new_v->u.rail.flags, VRF_REVERSE_DIRECTION); + } if (old_v->type == VEH_Train && !IsFrontEngine(old_v)) { /* this is a railcar. We need to move the car into the train