diff options
author | peter1138 <peter1138@openttd.org> | 2005-10-30 21:47:42 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2005-10-30 21:47:42 +0000 |
commit | f50ec50d9bcfbaa495cdd2bfd457d756317a6b42 (patch) | |
tree | 538fc1b9998ad93a31ed5be155e1b523b05073b8 /train_cmd.c | |
parent | 84684ef1a357096046a3108509ccc01b74f7f196 (diff) | |
download | openttd-f50ec50d9bcfbaa495cdd2bfd457d756317a6b42.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.c | 8 |
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]; |