mirror of https://github.com/OpenTTD/OpenTTD
(svn r3686) Dispel some strange magic regarding level crossings and foundations:
if a level crossing is on a sloped tile, it has to be on a level foundationrelease/0.5
parent
5e05cd4098
commit
03212c6488
20
road_cmd.c
20
road_cmd.c
|
@ -764,9 +764,6 @@ uint GetRoadFoundation(uint tileh, uint bits)
|
||||||
return i + 15;
|
return i + 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rail crossing
|
|
||||||
if ((bits & 0x10) && _valid_tileh_slopes_road[2][tileh]) return tileh;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,8 +845,7 @@ static void DrawTile_Road(TileInfo *ti)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: { // level crossing
|
case 1: { // level crossing
|
||||||
int f = GetRoadFoundation(ti->tileh, ti->map5 & 0xF);
|
if (ti->tileh != 0) DrawFoundation(ti, ti->tileh);
|
||||||
if (f) DrawFoundation(ti, f);
|
|
||||||
|
|
||||||
image = GetRailTypeInfo(GB(_m[ti->tile].m4, 0, 4))->base_sprites.crossing;
|
image = GetRailTypeInfo(GB(_m[ti->tile].m4, 0, 4))->base_sprites.crossing;
|
||||||
|
|
||||||
|
@ -931,9 +927,8 @@ static uint GetSlopeZ_Road(const TileInfo* ti)
|
||||||
// check if it's a foundation
|
// check if it's a foundation
|
||||||
if (ti->tileh != 0) {
|
if (ti->tileh != 0) {
|
||||||
switch (GB(ti->map5, 4, 4)) {
|
switch (GB(ti->map5, 4, 4)) {
|
||||||
case 0: // normal road
|
case 0: { // normal road
|
||||||
case 1: { // level crossing
|
uint f = GetRoadFoundation(ti->tileh, GB(ti->map5, 0, 4));
|
||||||
uint f = GetRoadFoundation(ti->tileh, ti->map5 & 0x3F);
|
|
||||||
if (f != 0) {
|
if (f != 0) {
|
||||||
if (f < 15) {
|
if (f < 15) {
|
||||||
// leveled foundation
|
// leveled foundation
|
||||||
|
@ -945,6 +940,8 @@ static uint GetSlopeZ_Road(const TileInfo* ti)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if these are on a slope then there's a level foundation
|
||||||
|
case 1: // level crossing
|
||||||
case 2: // depot
|
case 2: // depot
|
||||||
return z + 8;
|
return z + 8;
|
||||||
|
|
||||||
|
@ -960,9 +957,8 @@ static uint GetSlopeTileh_Road(const TileInfo *ti)
|
||||||
// check if it's a foundation
|
// check if it's a foundation
|
||||||
if (ti->tileh != 0) {
|
if (ti->tileh != 0) {
|
||||||
switch (GB(ti->map5, 4, 4)) {
|
switch (GB(ti->map5, 4, 4)) {
|
||||||
case 0: // normal road
|
case 0: { // normal road
|
||||||
case 1: { // level crossing
|
uint f = GetRoadFoundation(ti->tileh, GB(ti->map5, 0, 4));
|
||||||
uint f = GetRoadFoundation(ti->tileh, ti->map5 & 0x3F);
|
|
||||||
if (f != 0) {
|
if (f != 0) {
|
||||||
if (f < 15) {
|
if (f < 15) {
|
||||||
// leveled foundation
|
// leveled foundation
|
||||||
|
@ -974,6 +970,8 @@ static uint GetSlopeTileh_Road(const TileInfo *ti)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if these are on a slope then there's a level foundation
|
||||||
|
case 1: // level crossing
|
||||||
case 2: // depot
|
case 2: // depot
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue