diff options
author | bjarni <bjarni@openttd.org> | 2005-01-08 00:22:11 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2005-01-08 00:22:11 +0000 |
commit | 2da54df9dfab0a7cff27f1dbc6b50138bf202892 (patch) | |
tree | 0fbe8bd39cc3d5be12c7f806841524d980cbc6ff | |
parent | 116789022c70f8f34c839ef85db8701472b3d634 (diff) | |
download | openttd-2da54df9dfab0a7cff27f1dbc6b50138bf202892.tar.xz |
(svn r1419) fixed issue where autoreplacing dualheaded trains turned the last engine the wrong way
-rw-r--r-- | vehicle.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1500,7 +1500,12 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) const RailVehicleInfo *rvi = RailVehInfo(new_engine_type); byte capacity = rvi->capacity; - v->spritenum = rvi->image_index; + if (rvi->flags & RVI_MULTIHEAD && v->next == NULL ) { + v->spritenum = rvi->image_index + 1; // +1 is the mirrored end of the dualheaded engines + } else { + v->spritenum = rvi->image_index; + } + v->cargo_type = rvi->cargo_type; v->cargo_cap = rvi->capacity; v->max_speed = rvi->max_speed; |