src/openttd.cpp
changeset 10363 d47dabff0d29
parent 10317 54d8cced8d55
child 10380 b36a754e4c21
equal deleted inserted replaced
10357:5c767b7ef1af 10363:d47dabff0d29
  2499 				SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5));
  2499 				SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5));
  2500 			}
  2500 			}
  2501 		}
  2501 		}
  2502 	}
  2502 	}
  2503 
  2503 
       
  2504 	if (CheckSavegameVersion(62)) {
       
  2505 		/* Remove all trams from savegames without tram support.
       
  2506 		 * There would be trams without tram track under causing crashes sooner or later. */
       
  2507 		Vehicle *v;
       
  2508 		FOR_ALL_VEHICLES(v) {
       
  2509 			if (v->type == VEH_ROAD && v->First() == v &&
       
  2510 					HasBit(EngInfo(v->engine_type)->misc_flags, EF_ROAD_TRAM)) {
       
  2511 				if (_switch_mode_errorstr == INVALID_STRING_ID || _switch_mode_errorstr == STR_NEWGRF_COMPATIBLE_LOAD_WARNING) {
       
  2512 					_switch_mode_errorstr = STR_LOADGAME_REMOVED_TRAMS;
       
  2513 				}
       
  2514 				delete v;
       
  2515 			}
       
  2516 		}
       
  2517 	}
       
  2518 
  2504 	return InitializeWindowsAndCaches();
  2519 	return InitializeWindowsAndCaches();
  2505 }
  2520 }
  2506 
  2521 
  2507 /** Reload all NewGRF files during a running game. This is a cut-down
  2522 /** Reload all NewGRF files during a running game. This is a cut-down
  2508  * version of AfterLoadGame().
  2523  * version of AfterLoadGame().