mirror of https://github.com/OpenTTD/OpenTTD
(svn r9857) -Fix: loading of TTDP savegames with features that OTTD has.
parent
c53bd7404d
commit
042bcc0325
|
@ -329,6 +329,9 @@ static void FixOldVehicles()
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
Vehicle *u;
|
Vehicle *u;
|
||||||
|
|
||||||
|
/* We haven't used this bit for stations for ages */
|
||||||
|
if (v->type == VEH_ROAD) CLRBIT(v->u.road.state, RVS_IS_STOPPING);
|
||||||
|
|
||||||
FOR_ALL_VEHICLES_FROM(u, v->index + 1) {
|
FOR_ALL_VEHICLES_FROM(u, v->index + 1) {
|
||||||
/* If a vehicle has the same orders, add the link to eachother
|
/* If a vehicle has the same orders, add the link to eachother
|
||||||
* in both vehicles */
|
* in both vehicles */
|
||||||
|
@ -621,12 +624,7 @@ static const OldChunks station_chunk[] = {
|
||||||
};
|
};
|
||||||
static bool LoadOldStation(LoadgameState *ls, int num)
|
static bool LoadOldStation(LoadgameState *ls, int num)
|
||||||
{
|
{
|
||||||
Station *st;
|
Station *st = new (num) Station();
|
||||||
|
|
||||||
if (!AddBlockIfNeeded(&_Station_pool, num))
|
|
||||||
error("Stations: failed loading savegame: too many stations");
|
|
||||||
|
|
||||||
st = GetStation(num);
|
|
||||||
_current_station_id = num;
|
_current_station_id = num;
|
||||||
|
|
||||||
if (!LoadChunk(ls, st, station_chunk))
|
if (!LoadChunk(ls, st, station_chunk))
|
||||||
|
@ -1554,6 +1552,19 @@ static bool LoadOldMain(LoadgameState *ls)
|
||||||
|
|
||||||
for (i = 0; i < OLD_MAP_SIZE; i ++) {
|
for (i = 0; i < OLD_MAP_SIZE; i ++) {
|
||||||
switch (GetTileType(i)) {
|
switch (GetTileType(i)) {
|
||||||
|
case MP_STATION:
|
||||||
|
_m[i].m4 = 0; // We do not understand this TTDP station mapping (yet)
|
||||||
|
switch (_m[i].m5) {
|
||||||
|
/* We have drive through stops at a totally different place */
|
||||||
|
case 0x53: case 0x54: _m[i].m5 += GFX_BUS_BASE_EXT - 0x53; break;
|
||||||
|
case 0x57: case 0x58: _m[i].m5 += GFX_TRUCK_BASE_EXT - 0x57; break;
|
||||||
|
case 0x55: case 0x56: // Bus tram stop
|
||||||
|
case 0x59: case 0x5A: // Truck tram stop
|
||||||
|
DEBUG(oldloader, 0, "Loading failed - we don't support trams (yet)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case MP_RAILWAY:
|
case MP_RAILWAY:
|
||||||
/* We save presignals different from TTDPatch, convert them */
|
/* We save presignals different from TTDPatch, convert them */
|
||||||
if (GetRailTileType(i) == RAIL_TILE_SIGNALS) {
|
if (GetRailTileType(i) == RAIL_TILE_SIGNALS) {
|
||||||
|
|
Loading…
Reference in New Issue