mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r10151) [0.5] -Fix [FS#862]: train disconnects in some old TTD savegames.
This commit is contained in:
parent
c40f10d6d4
commit
516a01c761
16
oldloader.c
16
oldloader.c
|
@ -19,6 +19,7 @@
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "ai/ai.h"
|
#include "ai/ai.h"
|
||||||
#include "date.h"
|
#include "date.h"
|
||||||
|
#include "bridge_map.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
HEADER_SIZE = 49,
|
HEADER_SIZE = 49,
|
||||||
|
@ -356,6 +357,21 @@ static void FixOldVehicles(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsBridgeTile(v->tile) && IsBridgeRamp(v->tile) &&
|
||||||
|
(v->z_pos & (TILE_HEIGHT - 1)) == (TILE_HEIGHT - 1)) {
|
||||||
|
/* Under some circumstances the trains going up a ramp can be one
|
||||||
|
* pixel too low when they enter the bridge. This causes the train
|
||||||
|
* to "disappear" under the bridge, which causes the train to
|
||||||
|
* break into two pieces and crash slightly later.
|
||||||
|
*
|
||||||
|
* This "hack" will make the trains on those positions on the
|
||||||
|
* ramps run one pixel higher. This offset will be automatically
|
||||||
|
* "fixed" when it enters the bridge middle parts or when it
|
||||||
|
* drives down the ramp of the bridge.
|
||||||
|
*/
|
||||||
|
v->z_pos++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue