(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
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "sprite.h"
|
||||
#include "depot.h"
|
||||
#include "pbs.h"
|
||||
#include "train.h"
|
||||
|
||||
enum {
|
||||
/* Max stations: 64000 (64 * 1000) */
|
||||
@@ -2255,7 +2256,7 @@ static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
|
||||
byte dir;
|
||||
|
||||
if (v->type == VEH_Train) {
|
||||
if (IS_BYTE_INSIDE(_m[tile].m5, 0, 8) && v->subtype == TS_Front_Engine &&
|
||||
if (IS_BYTE_INSIDE(_m[tile].m5, 0, 8) && IsFrontEngine(v) &&
|
||||
!IsCompatibleTrainStationTile(tile + TileOffsByDir(v->direction >> 1), tile)) {
|
||||
|
||||
station_id = _m[tile].m2;
|
||||
|
||||
Reference in New Issue
Block a user