diff options
author | bjarni <bjarni@openttd.org> | 2005-11-18 23:41:03 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2005-11-18 23:41:03 +0000 |
commit | 16e65960b99b001e5233eabca306fc8a5a8a85ec (patch) | |
tree | 3dd0d12983f0eaa08af460475f1f8b0a2c961d75 /tunnelbridge_cmd.c | |
parent | 65d9eb07a986f6ba22ab06aa1066008db3bb216b (diff) | |
download | openttd-16e65960b99b001e5233eabca306fc8a5a8a85ec.tar.xz |
(svn r3218) -Feature: Multiheaded train engines will now stay in the same train
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
This fixes the assert when moving multiheaded engines (introduced in r3144)
Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs
-Codechange: train subtype is now a bitmask
This allows fast access to info like if it is a wagon or engine and if it is in front and so on
Note: savegame version bump
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 817c742cd..7d4882fe5 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -22,6 +22,7 @@ #include "debug.h" #include "variables.h" #include "bridge.h" +#include "train.h" #include "table/bridge_land.h" @@ -1479,7 +1480,7 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y vdir = v->direction >> 1; if (v->u.rail.track != 0x40 && dir == vdir) { - if (v->subtype == TS_Front_Engine && fc == _tunnel_fractcoord_1[dir]) { + if (IsFrontEngine(v) && fc == _tunnel_fractcoord_1[dir]) { if (v->spritenum < 4) SndPlayVehicleFx(SND_05_TRAIN_THROUGH_TUNNEL, v); return 0; @@ -1534,7 +1535,7 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y } } } else if (_m[tile].m5 & 0x80) { - if (v->type == VEH_Road || (v->type == VEH_Train && v->subtype == TS_Front_Engine)) { + if (v->type == VEH_Road || (v->type == VEH_Train && IsFrontEngine(v))) { uint h; if (GetTileSlope(tile, &h) != 0) |