summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-08-17 09:29:26 +0000
committertruelight <truelight@openttd.org>2004-08-17 09:29:26 +0000
commit4e3ad7598f7eb167d2b1afdd3a4e2c2de34d2281 (patch)
treee7aa3907ed683140d911d6e5d933d8de6a654cce
parent61264942d047ed0baab0863e73f01f864107150e (diff)
downloadopenttd-4e3ad7598f7eb167d2b1afdd3a4e2c2de34d2281.tar.xz
(svn r74) -Fix: [1009631] Wrong multihead selling (Bodewes)
-rw-r--r--train_cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index b973a937d..97c18f736 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -777,7 +777,8 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (p2 != 1) {
// sell last part of multiheaded?
last = GetLastVehicleInChain(v);
- if (is_firsthead_sprite(last->spritenum))
+ // Check if the end-part is the same engine and check if it is the rear-end
+ if (last->engine_type != first->engine_type || is_firsthead_sprite(last->spritenum))
last = NULL;
} else {
last = NULL;