summaryrefslogtreecommitdiff
path: root/src/saveload/afterload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r--src/saveload/afterload.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index d2b8b6d5d..514f29465 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -574,11 +574,11 @@ bool AfterLoadGame()
/* In old savegame versions, the heightlevel was coded in bits 0..3 of the type field */
for (TileIndex t = 0; t < map_size; t++) {
_m[t].height = GB(_m[t].type, 0, 4);
- SB(_m[t].type, 0, 2, GB(_m[t].m6, 0, 2));
- SB(_m[t].m6, 0, 2, 0);
+ SB(_m[t].type, 0, 2, GB(_me[t].m6, 0, 2));
+ SB(_me[t].m6, 0, 2, 0);
if (MayHaveBridgeAbove(t)) {
- SB(_m[t].type, 2, 2, GB(_m[t].m6, 6, 2));
- SB(_m[t].m6, 6, 2, 0);
+ SB(_m[t].type, 2, 2, GB(_me[t].m6, 6, 2));
+ SB(_me[t].m6, 6, 2, 0);
} else {
SB(_m[t].type, 2, 2, 0);
}
@@ -810,7 +810,7 @@ bool AfterLoadGame()
break;
case MP_STATION: {
- if (HasBit(_m[t].m6, 3)) SetBit(_m[t].m6, 2);
+ if (HasBit(_me[t].m6, 3)) SetBit(_me[t].m6, 2);
StationGfx gfx = GetStationGfx(t);
StationType st;
if ( IsInsideMM(gfx, 0, 8)) { // Rail station
@@ -848,7 +848,7 @@ bool AfterLoadGame()
ResetSignalHandlers();
return false;
}
- SB(_m[t].m6, 3, 3, st);
+ SB(_me[t].m6, 3, 3, st);
break;
}
}
@@ -1022,7 +1022,7 @@ bool AfterLoadGame()
case ROAD_TILE_NORMAL:
SB(_m[t].m4, 0, 4, GB(_m[t].m5, 0, 4));
SB(_m[t].m4, 4, 4, 0);
- SB(_m[t].m6, 2, 4, 0);
+ SB(_me[t].m6, 2, 4, 0);
break;
case ROAD_TILE_CROSSING:
SB(_m[t].m4, 5, 2, GB(_m[t].m5, 2, 2));
@@ -1061,19 +1061,19 @@ bool AfterLoadGame()
switch (GetRoadTileType(t)) {
default: SlErrorCorrupt("Invalid road tile type");
case ROAD_TILE_NORMAL:
- SB(_me[t].m7, 0, 4, GB(_m[t].m3, 0, 4)); // road works
- SB(_m[t].m6, 3, 3, GB(_m[t].m3, 4, 3)); // ground
- SB(_m[t].m3, 0, 4, GB(_m[t].m4, 4, 4)); // tram bits
- SB(_m[t].m3, 4, 4, GB(_m[t].m5, 0, 4)); // tram owner
- SB(_m[t].m5, 0, 4, GB(_m[t].m4, 0, 4)); // road bits
+ SB(_me[t].m7, 0, 4, GB(_m[t].m3, 0, 4)); // road works
+ SB(_me[t].m6, 3, 3, GB(_m[t].m3, 4, 3)); // ground
+ SB(_m[t].m3, 0, 4, GB(_m[t].m4, 4, 4)); // tram bits
+ SB(_m[t].m3, 4, 4, GB(_m[t].m5, 0, 4)); // tram owner
+ SB(_m[t].m5, 0, 4, GB(_m[t].m4, 0, 4)); // road bits
break;
case ROAD_TILE_CROSSING:
- SB(_me[t].m7, 0, 5, GB(_m[t].m4, 0, 5)); // road owner
- SB(_m[t].m6, 3, 3, GB(_m[t].m3, 4, 3)); // ground
- SB(_m[t].m3, 4, 4, GB(_m[t].m5, 0, 4)); // tram owner
- SB(_m[t].m5, 0, 1, GB(_m[t].m4, 6, 1)); // road axis
- SB(_m[t].m5, 5, 1, GB(_m[t].m4, 5, 1)); // crossing state
+ SB(_me[t].m7, 0, 5, GB(_m[t].m4, 0, 5)); // road owner
+ SB(_me[t].m6, 3, 3, GB(_m[t].m3, 4, 3)); // ground
+ SB(_m[t].m3, 4, 4, GB(_m[t].m5, 0, 4)); // tram owner
+ SB(_m[t].m5, 0, 1, GB(_m[t].m4, 6, 1)); // road axis
+ SB(_m[t].m5, 5, 1, GB(_m[t].m4, 5, 1)); // crossing state
break;
case ROAD_TILE_DEPOT:
@@ -1090,7 +1090,7 @@ bool AfterLoadGame()
if (!IsRoadStop(t)) break;
if (fix_roadtypes) SetRoadTypes(t, (RoadTypes)GB(_m[t].m3, 0, 3));
- SB(_me[t].m7, 0, 5, HasBit(_m[t].m6, 2) ? OWNER_TOWN : GetTileOwner(t));
+ SB(_me[t].m7, 0, 5, HasBit(_me[t].m6, 2) ? OWNER_TOWN : GetTileOwner(t));
SB(_m[t].m3, 4, 4, _m[t].m1);
_m[t].m4 = 0;
break;
@@ -1104,7 +1104,7 @@ bool AfterLoadGame()
SB(_me[t].m7, 0, 5, o); // road owner
SB(_m[t].m3, 4, 4, o == OWNER_NONE ? OWNER_TOWN : o); // tram owner
}
- SB(_m[t].m6, 2, 4, GB(_m[t].m2, 4, 4)); // bridge type
+ SB(_me[t].m6, 2, 4, GB(_m[t].m2, 4, 4)); // bridge type
SB(_me[t].m7, 5, 1, GB(_m[t].m4, 7, 1)); // snow/desert
_m[t].m2 = 0;
@@ -1838,7 +1838,7 @@ bool AfterLoadGame()
/* Increase HouseAnimationFrame from 5 to 7 bits */
for (TileIndex t = 0; t < map_size; t++) {
if (IsTileType(t, MP_HOUSE) && GetHouseType(t) >= NEW_HOUSE_OFFSET) {
- SB(_m[t].m6, 2, 6, GB(_m[t].m6, 3, 5));
+ SB(_me[t].m6, 2, 6, GB(_me[t].m6, 3, 5));
SB(_m[t].m3, 5, 1, 0);
}
}
@@ -1995,7 +1995,7 @@ bool AfterLoadGame()
/* Reordering/generalisation of the object bits. */
ObjectType type = _m[t].m5;
- SB(_m[t].m6, 2, 4, type == OBJECT_HQ ? GB(_m[t].m3, 2, 3) : 0);
+ SB(_me[t].m6, 2, 4, type == OBJECT_HQ ? GB(_m[t].m3, 2, 3) : 0);
_m[t].m3 = type == OBJECT_HQ ? GB(_m[t].m3, 1, 1) | GB(_m[t].m3, 0, 1) << 4 : 0;
/* Make sure those bits are clear as well! */
@@ -2016,8 +2016,8 @@ bool AfterLoadGame()
uint offset = _m[t].m3;
/* Also move the animation state. */
- _m[t].m3 = GB(_m[t].m6, 2, 4);
- SB(_m[t].m6, 2, 4, 0);
+ _m[t].m3 = GB(_me[t].m6, 2, 4);
+ SB(_me[t].m6, 2, 4, 0);
if (offset == 0) {
/* No offset, so make the object. */
@@ -2404,9 +2404,9 @@ bool AfterLoadGame()
case MP_HOUSE:
if (GetHouseType(t) >= NEW_HOUSE_OFFSET) {
uint per_proc = _me[t].m7;
- _me[t].m7 = GB(_m[t].m6, 2, 6) | (GB(_m[t].m3, 5, 1) << 6);
+ _me[t].m7 = GB(_me[t].m6, 2, 6) | (GB(_m[t].m3, 5, 1) << 6);
SB(_m[t].m3, 5, 1, 0);
- SB(_m[t].m6, 2, 6, min(per_proc, 63));
+ SB(_me[t].m6, 2, 6, min(per_proc, 63));
}
break;