src/openttd.cpp
branch0.6
changeset 10364 40889da45fc9
parent 10323 57d8fd25473e
child 10655 b862a4add8b0
equal deleted inserted replaced
10352:da787f26b8b6 10364:40889da45fc9
  2438 				SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5));
  2438 				SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5));
  2439 			}
  2439 			}
  2440 		}
  2440 		}
  2441 	}
  2441 	}
  2442 
  2442 
       
  2443 	if (CheckSavegameVersion(62)) {
       
  2444 		/* Remove all trams from savegames without tram support.
       
  2445 		 * There would be trams without tram track under causing crashes sooner or later. */
       
  2446 		Vehicle *v;
       
  2447 		FOR_ALL_VEHICLES(v) {
       
  2448 			if (v->type == VEH_ROAD && v->First() == v &&
       
  2449 					HasBit(EngInfo(v->engine_type)->misc_flags, EF_ROAD_TRAM)) {
       
  2450 				if (_switch_mode_errorstr == INVALID_STRING_ID || _switch_mode_errorstr == STR_NEWGRF_COMPATIBLE_LOAD_WARNING) {
       
  2451 					_switch_mode_errorstr = STR_LOADGAME_REMOVED_TRAMS;
       
  2452 				}
       
  2453 				delete v;
       
  2454 			}
       
  2455 		}
       
  2456 	}
       
  2457 
  2443 	return InitializeWindowsAndCaches();
  2458 	return InitializeWindowsAndCaches();
  2444 }
  2459 }
  2445 
  2460 
  2446 /** Reload all NewGRF files during a running game. This is a cut-down
  2461 /** Reload all NewGRF files during a running game. This is a cut-down
  2447  * version of AfterLoadGame().
  2462  * version of AfterLoadGame().