Fix #10362: NewGRF bridges without speed limits.
For bridges, a max speed of 0xFFFF (i.e. no effective limit) is no longer displayed as a limit in the UI. A max speed of 0 is also considered unlimited, for similarity to the roadtype and railtype interface.
This commit is contained in:

committed by
rubidium42

parent
3c80f2d14a
commit
01be423237
@@ -2190,7 +2190,7 @@ static ChangeInfoResult BridgeChangeInfo(uint brid, int numinfo, int prop, ByteR
|
||||
|
||||
case 0x0A: // Maximum length
|
||||
bridge->max_length = buf->ReadByte();
|
||||
if (bridge->max_length > 16) bridge->max_length = 0xFFFF;
|
||||
if (bridge->max_length > 16) bridge->max_length = UINT16_MAX;
|
||||
break;
|
||||
|
||||
case 0x0B: // Cost factor
|
||||
@@ -2199,6 +2199,7 @@ static ChangeInfoResult BridgeChangeInfo(uint brid, int numinfo, int prop, ByteR
|
||||
|
||||
case 0x0C: // Maximum speed
|
||||
bridge->speed = buf->ReadWord();
|
||||
if (bridge->speed == 0) bridge->speed = UINT16_MAX;
|
||||
break;
|
||||
|
||||
case 0x0D: { // Bridge sprite tables
|
||||
|
Reference in New Issue
Block a user