src/openttd.cpp
branchnoai
changeset 10181 54df587fef5d
parent 10142 56ee7da4ad56
child 10249 58810805030e
equal deleted inserted replaced
10172:f93d3b7df6c8 10181:54df587fef5d
  2309 				if (groundType != TREE_GROUND_SNOW_DESERT) SetTreeGroundDensity(t, groundType, 3);
  2309 				if (groundType != TREE_GROUND_SNOW_DESERT) SetTreeGroundDensity(t, groundType, 3);
  2310 			}
  2310 			}
  2311 		}
  2311 		}
  2312 	}
  2312 	}
  2313 
  2313 
       
  2314 
       
  2315 	if (CheckSavegameVersion(93)) {
       
  2316 		/* Rework of orders. */
       
  2317 		Order *order;
       
  2318 		FOR_ALL_ORDERS(order) order->ConvertFromOldSavegame();
       
  2319 
       
  2320 		Vehicle *v;
       
  2321 		FOR_ALL_VEHICLES(v) {
       
  2322 			if (v->orders != NULL && !v->orders->IsValid()) v->orders = NULL;
       
  2323 
       
  2324 			v->current_order.ConvertFromOldSavegame();
       
  2325 			if (v->type == VEH_ROAD && v->IsPrimaryVehicle() && v->prev_shared == NULL) {
       
  2326 				FOR_VEHICLE_ORDERS(v, order) order->SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
       
  2327 			}
       
  2328 		}
       
  2329 	} else if (CheckSavegameVersion(94)) {
       
  2330 		/* Unload and transfer are now mutual exclusive. */
       
  2331 		Order *order;
       
  2332 		FOR_ALL_ORDERS(order) {
       
  2333 			if ((order->GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) == (OUFB_UNLOAD | OUFB_TRANSFER)) {
       
  2334 				order->SetUnloadType(OUFB_TRANSFER);
       
  2335 				order->SetLoadType(OLFB_NO_LOAD);
       
  2336 			}
       
  2337 		}
       
  2338 
       
  2339 		Vehicle *v;
       
  2340 		FOR_ALL_VEHICLES(v) {
       
  2341 			if ((v->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) == (OUFB_UNLOAD | OUFB_TRANSFER)) {
       
  2342 				v->current_order.SetUnloadType(OUFB_TRANSFER);
       
  2343 				v->current_order.SetLoadType(OLFB_NO_LOAD);
       
  2344 			}
       
  2345 		}
       
  2346 	}
       
  2347 
  2314 	if (CheckSavegameVersion(84)) {
  2348 	if (CheckSavegameVersion(84)) {
  2315 		/* Update go to buoy orders because they are just waypoints */
  2349 		/* Update go to buoy orders because they are just waypoints */
  2316 		Order *order;
  2350 		Order *order;
  2317 		FOR_ALL_ORDERS(order) {
  2351 		FOR_ALL_ORDERS(order) {
  2318 			if (order->IsType(OT_GOTO_STATION) && GetStation(order->GetDestination())->IsBuoy()) {
  2352 			if (order->IsType(OT_GOTO_STATION) && GetStation(order->GetDestination())->IsBuoy()) {
  2453 				SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5));
  2487 				SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5));
  2454 			}
  2488 			}
  2455 		}
  2489 		}
  2456 	}
  2490 	}
  2457 
  2491 
  2458 	if (CheckSavegameVersion(93)) {
       
  2459 		/* Rework of orders. */
       
  2460 		Order *order;
       
  2461 		FOR_ALL_ORDERS(order) order->ConvertFromOldSavegame();
       
  2462 
       
  2463 		Vehicle *v;
       
  2464 		FOR_ALL_VEHICLES(v) v->current_order.ConvertFromOldSavegame();
       
  2465 	} else if (CheckSavegameVersion(94)) {
       
  2466 		/* Unload and transfer are now mutual exclusive. */
       
  2467 		Order *order;
       
  2468 		FOR_ALL_ORDERS(order) {
       
  2469 			if ((order->GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) == (OUFB_UNLOAD | OUFB_TRANSFER)) {
       
  2470 				order->SetUnloadType(OUFB_TRANSFER);
       
  2471 				order->SetLoadType(OLFB_NO_LOAD);
       
  2472 			}
       
  2473 		}
       
  2474 
       
  2475 		Vehicle *v;
       
  2476 		FOR_ALL_VEHICLES(v) {
       
  2477 			if ((v->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) == (OUFB_UNLOAD | OUFB_TRANSFER)) {
       
  2478 				v->current_order.SetUnloadType(OUFB_TRANSFER);
       
  2479 				v->current_order.SetLoadType(OLFB_NO_LOAD);
       
  2480 			}
       
  2481 		}
       
  2482 	}
       
  2483 
       
  2484 	return InitializeWindowsAndCaches();
  2492 	return InitializeWindowsAndCaches();
  2485 }
  2493 }
  2486 
  2494 
  2487 /** Reload all NewGRF files during a running game. This is a cut-down
  2495 /** Reload all NewGRF files during a running game. This is a cut-down
  2488  * version of AfterLoadGame().
  2496  * version of AfterLoadGame().