Changeset - r2421:49aaa21511e2
[Not reviewed]
master
0 1 0
tron - 19 years ago 2005-09-13 09:23:23
tron@openttd.org
(svn r2947) Reorder some code to prepare for future enhancements and get rid of some gotos (peter1138)
1 file changed with 22 insertions and 11 deletions:
newgrf.c
22
11
0 comments (0 inline, 0 general)
newgrf.c
Show inline comments
 
@@ -1053,11 +1053,14 @@ static void VehicleChangeInfo(byte *buf,
 

	
 
	while (numprops-- && buf < bufend) {
 
		uint8 prop = grf_load_byte(&buf);
 
		bool ignoring = false;
 

	
 
		if (feature == GSF_STATION)
 
			// stations don't share those common properties
 
			goto run_handler;
 

	
 
		switch (feature) {
 
			case GSF_TRAIN:
 
			case GSF_ROAD:
 
			case GSF_SHIP:
 
			case GSF_AIRCRAFT:
 
				/* Common properties for vehicles */
 
		switch (prop) {
 
		case 0x00: { /* Introduction date */
 
			FOR_EACH_OBJECT {
 
@@ -1106,17 +1109,25 @@ static void VehicleChangeInfo(byte *buf,
 
			FOR_EACH_OBJECT {
 
				grf_load_byte(&buf);
 
			}
 
			goto ignoring;
 
						ignoring = true;
 
						break;
 
		}
 
		default: {
 
run_handler:
 
			if (handler[feature](engine, numinfo, prop, &buf, bufend - buf)) {
 
ignoring:
 
				grfmsg(GMS_NOTICE, "VehicleChangeInfo: Ignoring property %x (not implemented).", prop);
 

	
 
					default:
 
						if (handler[feature](engine, numinfo, prop, &buf, bufend - buf))
 
							ignoring = true;
 
						break;
 
			}
 
			break;
 

	
 
			default:
 
				if (handler[feature](engine, numinfo, prop, &buf, bufend - buf))
 
					ignoring = true;
 
				break;
 
		}
 
		}
 

	
 
		if (ignoring)
 
			grfmsg(GMS_NOTICE, "VehicleChangeInfo: Ignoring property %x (not implemented).", prop);
 
	}
 
}
 

	
0 comments (0 inline, 0 general)