Implement rail station property 1B, bridge clearance information

This commit is contained in:
Jonathan G Rennison
2018-08-02 08:27:20 +01:00
parent 76a7b70cad
commit ef0a0b0f8e
6 changed files with 86 additions and 25 deletions

View File

@@ -1965,7 +1965,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
break;
case 0x0E: // Define custom layout
statspec->copied_layouts = false;
ClrBit(statspec->internal_flags, SSIF_COPIED_LAYOUTS);
while (buf->HasData()) {
byte length = buf->ReadByte();
@@ -2028,7 +2028,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
statspec->lengths = srcstatspec->lengths;
statspec->platforms = srcstatspec->platforms;
statspec->layouts = srcstatspec->layouts;
statspec->copied_layouts = true;
SetBit(statspec->internal_flags, SSIF_COPIED_LAYOUTS);
break;
}
@@ -2086,6 +2086,13 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
}
break;
case 0x1B: // Minimum height for a bridge above
SetBit(statspec->internal_flags, SSIF_BRIDGE_HEIGHTS_SET);
for (uint i = 0; i < 8; i++) {
statspec->bridge_height[i] = buf->ReadByte();
}
break;
default:
ret = CIR_UNKNOWN;
break;
@@ -7927,7 +7934,7 @@ static void ResetCustomStations()
delete[] statspec->renderdata;
/* Release platforms and layouts */
if (!statspec->copied_layouts) {
if (!HasBit(statspec->internal_flags, SSIF_COPIED_LAYOUTS)) {
for (uint l = 0; l < statspec->lengths; l++) {
for (uint p = 0; p < statspec->platforms[l]; p++) {
free(statspec->layouts[l][p]);