1368 { |
1368 { |
1369 return LoadChunk(ls, &_subsidies[num], subsidy_chunk); |
1369 return LoadChunk(ls, &_subsidies[num], subsidy_chunk); |
1370 } |
1370 } |
1371 |
1371 |
1372 static const OldChunks game_difficulty_chunk[] = { |
1372 static const OldChunks game_difficulty_chunk[] = { |
1373 OCL_SVAR( OC_UINT16, GameDifficulty, max_no_competitors ), |
1373 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, max_no_competitors ), |
1374 OCL_SVAR( OC_UINT16, GameDifficulty, competitor_start_time ), |
1374 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, competitor_start_time ), |
1375 OCL_SVAR( OC_UINT16, GameDifficulty, number_towns ), |
1375 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, number_towns ), |
1376 OCL_SVAR( OC_UINT16, GameDifficulty, number_industries ), |
1376 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, number_industries ), |
1377 OCL_SVAR( OC_UINT16, GameDifficulty, max_loan ), |
1377 OCL_SVAR( OC_FILE_U16 | OC_VAR_U16, DifficultySettings, max_loan ), |
1378 OCL_SVAR( OC_UINT16, GameDifficulty, initial_interest ), |
1378 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, initial_interest ), |
1379 OCL_SVAR( OC_UINT16, GameDifficulty, vehicle_costs ), |
1379 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, vehicle_costs ), |
1380 OCL_SVAR( OC_UINT16, GameDifficulty, competitor_speed ), |
1380 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, competitor_speed ), |
1381 OCL_SVAR( OC_UINT16, GameDifficulty, competitor_intelligence ), |
1381 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, competitor_intelligence ), |
1382 OCL_SVAR( OC_UINT16, GameDifficulty, vehicle_breakdowns ), |
1382 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, vehicle_breakdowns ), |
1383 OCL_SVAR( OC_UINT16, GameDifficulty, subsidy_multiplier ), |
1383 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, subsidy_multiplier ), |
1384 OCL_SVAR( OC_UINT16, GameDifficulty, construction_cost ), |
1384 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, construction_cost ), |
1385 OCL_SVAR( OC_UINT16, GameDifficulty, terrain_type ), |
1385 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, terrain_type ), |
1386 OCL_SVAR( OC_UINT16, GameDifficulty, quantity_sea_lakes ), |
1386 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, quantity_sea_lakes ), |
1387 OCL_SVAR( OC_UINT16, GameDifficulty, economy ), |
1387 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, economy ), |
1388 OCL_SVAR( OC_UINT16, GameDifficulty, line_reverse_mode ), |
1388 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, line_reverse_mode ), |
1389 OCL_SVAR( OC_UINT16, GameDifficulty, disasters ), |
1389 OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, DifficultySettings, disasters ), |
1390 OCL_END() |
1390 OCL_END() |
1391 }; |
1391 }; |
1392 |
1392 |
1393 static inline bool LoadOldGameDifficulty(LoadgameState *ls, int num) |
1393 static inline bool LoadOldGameDifficulty(LoadgameState *ls, int num) |
1394 { |
1394 { |
1395 return LoadChunk(ls, &_opt.diff, game_difficulty_chunk); |
1395 return LoadChunk(ls, &_settings.difficulty, game_difficulty_chunk); |
1396 } |
1396 } |
1397 |
1397 |
1398 |
1398 |
1399 static bool LoadOldMapPart1(LoadgameState *ls, int num) |
1399 static bool LoadOldMapPart1(LoadgameState *ls, int num) |
1400 { |
1400 { |
1568 OCL_NULL( 144 ), ///< AI cargo-stuff, calculated in InitializeLandscapeVariables |
1568 OCL_NULL( 144 ), ///< AI cargo-stuff, calculated in InitializeLandscapeVariables |
1569 OCL_NULL( 2 ), ///< Company indexes of players, no longer in use |
1569 OCL_NULL( 2 ), ///< Company indexes of players, no longer in use |
1570 |
1570 |
1571 OCL_VAR ( OC_FILE_U8 | OC_VAR_U16, 1, &_station_tick_ctr ), |
1571 OCL_VAR ( OC_FILE_U8 | OC_VAR_U16, 1, &_station_tick_ctr ), |
1572 |
1572 |
1573 OCL_VAR ( OC_UINT8, 1, &_opt.currency ), |
1573 OCL_VAR ( OC_UINT8, 1, &_settings.gui.currency ), |
1574 OCL_VAR ( OC_UINT8, 1, &_opt.units ), |
1574 OCL_VAR ( OC_UINT8, 1, &_settings.gui.units ), |
1575 OCL_VAR ( OC_FILE_U8 | OC_VAR_U32, 1, &_cur_player_tick_index ), |
1575 OCL_VAR ( OC_FILE_U8 | OC_VAR_U32, 1, &_cur_player_tick_index ), |
1576 |
1576 |
1577 OCL_NULL( 2 ), ///< Date stuff, calculated automatically |
1577 OCL_NULL( 2 ), ///< Date stuff, calculated automatically |
1578 OCL_NULL( 8 ), ///< Player colors, calculated automatically |
1578 OCL_NULL( 8 ), ///< Player colors, calculated automatically |
1579 |
1579 |
1580 OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount ), |
1580 OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount ), |
1581 OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount_pr ), |
1581 OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount_pr ), |
1582 OCL_VAR ( OC_UINT8, 1, &_economy.interest_rate ), |
1582 OCL_VAR ( OC_UINT8, 1, &_economy.interest_rate ), |
1583 OCL_NULL( 1 ), // available airports |
1583 OCL_NULL( 1 ), // available airports |
1584 OCL_VAR ( OC_UINT8, 1, &_opt.road_side ), |
1584 OCL_VAR ( OC_UINT8, 1, &_settings.vehicle.road_side ), |
1585 OCL_VAR ( OC_UINT8, 1, &_opt.town_name ), |
1585 OCL_VAR ( OC_UINT8, 1, &_settings.game_creation.town_name ), |
1586 |
1586 |
1587 OCL_CHUNK( 1, LoadOldGameDifficulty ), |
1587 OCL_CHUNK( 1, LoadOldGameDifficulty ), |
1588 |
1588 |
1589 OCL_ASSERT( 0x77130 ), |
1589 OCL_ASSERT( 0x77130 ), |
1590 |
1590 |
1591 OCL_VAR ( OC_UINT8, 1, &_opt.diff_level ), |
1591 OCL_VAR ( OC_UINT8, 1, &_settings.difficulty.diff_level ), |
1592 OCL_VAR ( OC_UINT8, 1, &_opt.landscape ), |
1592 OCL_VAR ( OC_UINT8, 1, &_settings.game_creation.landscape ), |
1593 OCL_VAR ( OC_UINT8, 1, &_trees_tick_ctr ), |
1593 OCL_VAR ( OC_UINT8, 1, &_trees_tick_ctr ), |
1594 |
1594 |
1595 OCL_NULL( 1 ), ///< Custom vehicle types yes/no, no longer used |
1595 OCL_NULL( 1 ), ///< Custom vehicle types yes/no, no longer used |
1596 OCL_VAR ( OC_UINT8, 1, &_opt.snow_line ), |
1596 OCL_VAR ( OC_UINT8, 1, &_settings.game_creation.snow_line ), |
1597 |
1597 |
1598 OCL_NULL( 32 ), ///< new_industry_randtable, no longer used (because of new design) |
1598 OCL_NULL( 32 ), ///< new_industry_randtable, no longer used (because of new design) |
1599 OCL_NULL( 36 ), ///< cargo-stuff, calculated in InitializeLandscapeVariables |
1599 OCL_NULL( 36 ), ///< cargo-stuff, calculated in InitializeLandscapeVariables |
1600 |
1600 |
1601 OCL_ASSERT( 0x77179 ), |
1601 OCL_ASSERT( 0x77179 ), |