Changeset - r19165:1353a268dd5f
[Not reviewed]
master
0 1 0
michi_cc - 12 years ago 2012-03-20 13:11:20
michi_cc@openttd.org
(svn r24053) -Fix (r23947) [FS#5111]: Crash when timetabling a maximum travel speed of 0.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/timetable_cmd.cpp
Show inline comments
 
@@ -109,24 +109,25 @@ CommandCost CmdChangeTimetable(TileIndex
 
	int max_speed   = order->max_speed;
 
	switch (mtf) {
 
		case MTF_WAIT_TIME:
 
			wait_time = GB(p2, 0, 16);
 
			break;
 

	
 
		case MTF_TRAVEL_TIME:
 
			travel_time = GB(p2, 0, 16);
 
			break;
 

	
 
		case MTF_TRAVEL_SPEED:
 
			max_speed = GB(p2, 0, 16);
 
			if (max_speed == 0) max_speed = UINT16_MAX; // Disable speed limit.
 
			break;
 

	
 
		default:
 
			NOT_REACHED();
 
	}
 

	
 
	if (wait_time != order->wait_time) {
 
		switch (order->GetType()) {
 
			case OT_GOTO_STATION:
 
				if (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) return_cmd_error(STR_ERROR_TIMETABLE_NOT_STOPPING_HERE);
 
				break;
 

	
0 comments (0 inline, 0 general)