Changeset - r20131:856d2ee4719d
[Not reviewed]
master
0 1 0
frosch - 11 years ago 2013-03-17 18:31:35
frosch@openttd.org
(svn r25099) -Fix [FS#5492]: Limit aircraft property 0D to 19, since the conversion result to km-ish/h needs to fit into a byte.
1 file changed with 9 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -1618,9 +1618,15 @@ static ChangeInfoResult AircraftVehicleC
 
				avi->max_speed = (buf->ReadByte() * 128) / 10;
 
				break;
 

	
 
			case 0x0D: // Acceleration
 
				avi->acceleration = (buf->ReadByte() * 128) / 10;
 
				break;
 
			case 0x0D: { // Acceleration
 
				uint acceleration = (buf->ReadByte() * 128) / 10;
 
				if (acceleration > UINT8_MAX) {
 
					grfmsg(1, "Acceleration property of aircraft %d is too big.", engine + i);
 
					acceleration = UINT8_MAX;
 
				}
 
				avi->acceleration = acceleration;
 
				break;
 
			}
 

	
 
			case PROP_AIRCRAFT_RUNNING_COST_FACTOR: // 0x0E Running cost factor
 
				avi->running_cost = buf->ReadByte();
0 comments (0 inline, 0 general)