summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-10-30 21:47:42 +0000
committerpeter1138 <peter1138@openttd.org>2005-10-30 21:47:42 +0000
commit1a2ad83b00d2a3826950ea7c5339c54d637a308c (patch)
tree538fc1b9998ad93a31ed5be155e1b523b05073b8 /train_cmd.c
parent328158395b19f19960f209e8edd8a9f694caafbc (diff)
downloadopenttd-1a2ad83b00d2a3826950ea7c5339c54d637a308c.tar.xz
(svn r3107) -NewGRF: Move train y-position offset adjustment to remove code duplication, and make it apply only to vehicles with a custom image.
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 6ee0e031f..ef11c55ce 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -364,6 +364,8 @@ int GetTrainImage(const Vehicle *v, byte direction)
return base;
}
+extern int _traininfo_vehicle_pitch;
+
void DrawTrainEngine(int x, int y, EngineID engine, uint32 image_ormod)
{
const RailVehicleInfo *rvi = RailVehInfo(engine);
@@ -373,7 +375,11 @@ void DrawTrainEngine(int x, int y, EngineID engine, uint32 image_ormod)
if (is_custom_sprite(img)) {
image = GetCustomVehicleIcon(engine, 6);
- if (image == 0) img = orig_rail_vehicle_info[engine].image_index;
+ if (image == 0) {
+ img = orig_rail_vehicle_info[engine].image_index;
+ } else {
+ y += _traininfo_vehicle_pitch;
+ }
}
if (image == 0) {
image = (6 & _engine_sprite_and[img]) + _engine_sprite_base[img];