418 uint16 timer_counter; |
418 uint16 timer_counter; |
419 uint16 land_code; // NOLOAD: never needed in game |
419 uint16 land_code; // NOLOAD: never needed in game |
420 uint16 age_cargo_skip_counter; |
420 uint16 age_cargo_skip_counter; |
421 uint16 tick_counter; |
421 uint16 tick_counter; |
422 uint16 cur_tileloop_tile; |
422 uint16 cur_tileloop_tile; |
423 |
423 |
424 OldPrice prices[49]; |
424 OldPrice prices[49]; |
425 OldPaymentRate cargo_payment_rates[12]; |
425 OldPaymentRate cargo_payment_rates[12]; |
426 |
426 |
427 byte map_owner[256*256]; |
427 byte map_owner[256*256]; |
428 byte map2[256*256]; |
428 byte map2[256*256]; |
429 uint16 map3[256*256]; |
429 uint16 map3[256*256]; |
430 byte map_extra[256*256/4]; |
430 byte map_extra[256*256/4]; |
431 |
431 |
432 OldStation stations[250]; |
432 OldStation stations[250]; |
433 OldIndustry industries[90]; |
433 OldIndustry industries[90]; |
434 OldPlayer players[8]; |
434 OldPlayer players[8]; |
435 OldVehicle vehicles[850]; |
435 OldVehicle vehicles[850]; |
436 OldName names[500]; |
436 OldName names[500]; |
437 |
437 |
438 uint16 vehicle_position_hash[0x1000]; // NOLOAD, calculated automatically. |
438 uint16 vehicle_position_hash[0x1000]; // NOLOAD, calculated automatically. |
439 |
439 |
440 OldSign signs[40]; |
440 OldSign signs[40]; |
441 OldEngine engines[256]; |
441 OldEngine engines[256]; |
442 |
442 |
453 //NOLOAD. These are calculated from InitializeLandscapeVariables |
453 //NOLOAD. These are calculated from InitializeLandscapeVariables |
454 uint16 cargo_names_s[12], cargo_names_p[12], cargo_names_long_s[12], cargo_names_long_p[12], cargo_names_short[12]; |
454 uint16 cargo_names_s[12], cargo_names_p[12], cargo_names_long_s[12], cargo_names_long_p[12], cargo_names_short[12]; |
455 uint16 cargo_sprites[12]; |
455 uint16 cargo_sprites[12]; |
456 |
456 |
457 uint16 engine_name_strings[256]; |
457 uint16 engine_name_strings[256]; |
458 |
458 |
459 //NOLOAD. These are calculated from InitializeLandscapeVariables |
459 //NOLOAD. These are calculated from InitializeLandscapeVariables |
460 uint16 railveh_by_cargo_1[12], railveh_by_cargo_2[12], railveh_by_cargo_3[12]; |
460 uint16 railveh_by_cargo_1[12], railveh_by_cargo_2[12], railveh_by_cargo_3[12]; |
461 uint16 roadveh_by_cargo_start[12]; |
461 uint16 roadveh_by_cargo_start[12]; |
462 byte roadveh_by_cargo_count[12]; |
462 byte roadveh_by_cargo_count[12]; |
463 uint16 ship_of_type_start[12]; |
463 uint16 ship_of_type_start[12]; |
640 i->accepts_cargo[1] = o->accepts_cargo[1]; |
640 i->accepts_cargo[1] = o->accepts_cargo[1]; |
641 i->accepts_cargo[2] = o->accepts_cargo[2]; |
641 i->accepts_cargo[2] = o->accepts_cargo[2]; |
642 i->prod_level = o->prod_level; |
642 i->prod_level = o->prod_level; |
643 i->last_mo_production[0] = o->last_mo_production[0]; |
643 i->last_mo_production[0] = o->last_mo_production[0]; |
644 i->last_mo_production[1] = o->last_mo_production[1]; |
644 i->last_mo_production[1] = o->last_mo_production[1]; |
645 |
645 |
646 i->last_mo_transported[0] = o->last_mo_transported[0]; |
646 i->last_mo_transported[0] = o->last_mo_transported[0]; |
647 i->last_mo_transported[1] = o->last_mo_transported[1]; |
647 i->last_mo_transported[1] = o->last_mo_transported[1]; |
648 i->last_mo_transported[2] = o->last_mo_transported[2]; |
648 i->last_mo_transported[2] = o->last_mo_transported[2]; |
649 |
649 |
650 i->pct_transported[0] = o->pct_transported[0]; |
650 i->pct_transported[0] = o->pct_transported[0]; |
651 i->pct_transported[1] = o->pct_transported[1]; |
651 i->pct_transported[1] = o->pct_transported[1]; |
652 |
652 |
653 i->total_production[0] = o->total_production[0]; |
653 i->total_production[0] = o->total_production[0]; |
654 i->total_production[1] = o->total_production[1]; |
654 i->total_production[1] = o->total_production[1]; |
655 |
655 |
656 i->total_transported[0] = i->total_transported[0]; |
656 i->total_transported[0] = i->total_transported[0]; |
657 i->total_transported[1] = i->total_transported[1]; |
657 i->total_transported[1] = i->total_transported[1]; |
658 |
658 |
659 i->type = o->type; |
659 i->type = o->type; |
660 i->owner = o->owner; |
660 i->owner = o->owner; |
686 s->bus_tile = o->bus_tile; |
686 s->bus_tile = o->bus_tile; |
687 s->lorry_tile = o->lorry_tile; |
687 s->lorry_tile = o->lorry_tile; |
688 s->train_tile = o->train_tile; |
688 s->train_tile = o->train_tile; |
689 s->airport_tile = o->airport_tile; |
689 s->airport_tile = o->airport_tile; |
690 s->dock_tile = o->dock_tile; |
690 s->dock_tile = o->dock_tile; |
691 |
691 |
692 if (o->train_tile) { |
692 if (o->train_tile) { |
693 int w = (o->platforms >> 3) & 0x7; |
693 int w = (o->platforms >> 3) & 0x7; |
694 int h = (o->platforms & 0x7); |
694 int h = (o->platforms & 0x7); |
695 if (_map5[o->train_tile]&1) intswap(w,h); |
695 if (_map5[o->train_tile]&1) intswap(w,h); |
696 s->trainst_w = w; |
696 s->trainst_w = w; |
697 s->trainst_h = h; |
697 s->trainst_h = h; |
698 } |
698 } |
699 |
699 |
700 s->string_id = RemapOldStringID(o->string_id); |
700 s->string_id = RemapOldStringID(o->string_id); |
701 s->had_vehicle_of_type = o->had_vehicle_of_type; |
701 s->had_vehicle_of_type = o->had_vehicle_of_type; |
702 FixGoodsEntry(s->goods, o->goods, lengthof(o->goods)); |
702 FixGoodsEntry(s->goods, o->goods, lengthof(o->goods)); |
703 s->time_since_load = o->time_since_load; |
703 s->time_since_load = o->time_since_load; |
704 s->time_since_unload = o->time_since_unload; |
704 s->time_since_unload = o->time_since_unload; |
903 n->quarters_of_bankrupcy = o->quarters_of_bankrupcy; |
903 n->quarters_of_bankrupcy = o->quarters_of_bankrupcy; |
904 n->bankrupt_asked = o->bankrupt_asked; |
904 n->bankrupt_asked = o->bankrupt_asked; |
905 n->bankrupt_value = o->bankrupt_value; |
905 n->bankrupt_value = o->bankrupt_value; |
906 n->bankrupt_timeout = o->bankrupt_timeout; |
906 n->bankrupt_timeout = o->bankrupt_timeout; |
907 n->cargo_types = o->cargo_types; |
907 n->cargo_types = o->cargo_types; |
908 |
908 |
909 for(i=0; i!=3; i++) |
909 for(i=0; i!=3; i++) |
910 for(j=0; j!=13; j++) |
910 for(j=0; j!=13; j++) |
911 n->yearly_expenses[i][j] = o->expenses[i].cost[j]; |
911 n->yearly_expenses[i][j] = o->expenses[i].cost[j]; |
912 |
912 |
913 FixEconomy(&n->cur_economy, &o->economy[0]); |
913 FixEconomy(&n->cur_economy, &o->economy[0]); |
914 for(i=0; i!=24; i++) FixEconomy(&n->old_economy[i], &o->economy[i+1]); |
914 for(i=0; i!=24; i++) FixEconomy(&n->old_economy[i], &o->economy[i+1]); |
915 n->inaugurated_year = o->inaugurated_date - 1920; |
915 n->inaugurated_year = o->inaugurated_date - 1920; |
916 n->last_build_coordinate = o->last_build_coordinate; |
916 n->last_build_coordinate = o->last_build_coordinate; |
917 n->num_valid_stat_ent = o->num_valid_stat_ent; |
917 n->num_valid_stat_ent = o->num_valid_stat_ent; |
918 |
918 |
919 /* Not good, since AI doesn't have a vehicle assigned as |
919 /* Not good, since AI doesn't have a vehicle assigned as |
920 * in p->ai.cur_veh and thus will crash on certain actions. |
920 * in p->ai.cur_veh and thus will crash on certain actions. |
921 * Best is to set state to AiStateVehLoop (2) |
921 * Best is to set state to AiStateVehLoop (2) |
922 * n->ai.state = o->ai_state; |
922 * n->ai.state = o->ai_state; |
923 */ |
923 */ |
924 n->ai.state = 2; |
924 n->ai.state = 2; |
925 n->ai.state_mode = o->ai_state_mode; |
925 n->ai.state_mode = o->ai_state_mode; |
926 n->ai.state_counter = o->ai_state_counter; |
926 n->ai.state_counter = o->ai_state_counter; |
927 n->ai.timeout_counter = o->ai_timeout_counter; |
927 n->ai.timeout_counter = o->ai_timeout_counter; |
928 n->ai.banned_tile_count = o->ai_banned_tile_count; |
928 n->ai.banned_tile_count = o->ai_banned_tile_count; |
929 n->ai.railtype_to_use = o->ai_railtype_to_use; |
929 n->ai.railtype_to_use = o->ai_railtype_to_use; |
930 |
930 |
931 FixAiBuildRec(&n->ai.src, &o->ai_src); |
931 FixAiBuildRec(&n->ai.src, &o->ai_src); |
932 FixAiBuildRec(&n->ai.dst, &o->ai_dst); |
932 FixAiBuildRec(&n->ai.dst, &o->ai_dst); |
933 FixAiBuildRec(&n->ai.mid1, &o->ai_mid1); |
933 FixAiBuildRec(&n->ai.mid1, &o->ai_mid1); |
934 FixAiBuildRec(&n->ai.mid2, &o->ai_mid2); |
934 FixAiBuildRec(&n->ai.mid2, &o->ai_mid2); |
935 |
935 |
936 n->ai.cargo_type = o->ai_cargo_type; |
936 n->ai.cargo_type = o->ai_cargo_type; |
937 n->ai.num_wagons = o->ai_num_wagons; |
937 n->ai.num_wagons = o->ai_num_wagons; |
938 n->ai.num_build_rec = o->ai_num_build_rec; |
938 n->ai.num_build_rec = o->ai_num_build_rec; |
939 n->ai.num_loco_to_build = o->ai_num_loco_to_build; |
939 n->ai.num_loco_to_build = o->ai_num_loco_to_build; |
940 n->ai.num_want_fullload = o->ai_num_want_fullload; |
940 n->ai.num_want_fullload = o->ai_num_want_fullload; |
941 |
941 |
942 for(i=0; i!=9; i++) n->ai.wagon_list[i] = o->ai_wagonlist[i]; |
942 for(i=0; i!=9; i++) n->ai.wagon_list[i] = o->ai_wagonlist[i]; |
943 memcpy(n->ai.order_list_blocks, o->ai_order_list_blocks, 20); |
943 memcpy(n->ai.order_list_blocks, o->ai_order_list_blocks, 20); |
944 n->ai.start_tile_a = o->ai_start_tile_a; |
944 n->ai.start_tile_a = o->ai_start_tile_a; |
945 n->ai.start_tile_b = o->ai_start_tile_b; |
945 n->ai.start_tile_b = o->ai_start_tile_b; |
946 n->ai.cur_tile_a = o->ai_cur_tile_a; |
946 n->ai.cur_tile_a = o->ai_cur_tile_a; |
947 n->ai.cur_tile_b = o->ai_cur_tile_b; |
947 n->ai.cur_tile_b = o->ai_cur_tile_b; |
948 n->ai.start_dir_a = o->ai_start_dir_a; |
948 n->ai.start_dir_a = o->ai_start_dir_a; |
949 n->ai.start_dir_b = o->ai_start_dir_b; |
949 n->ai.start_dir_b = o->ai_start_dir_b; |
950 n->ai.cur_dir_a = o->ai_cur_dir_a; |
950 n->ai.cur_dir_a = o->ai_cur_dir_a; |
951 n->ai.cur_dir_b = o->ai_cur_dir_b; |
951 n->ai.cur_dir_b = o->ai_cur_dir_b; |
952 |
952 |
953 for(i=0; i!=16; i++) { |
953 for(i=0; i!=16; i++) { |
954 n->ai.banned_tiles[i] = o->banned_tiles[i].tile; |
954 n->ai.banned_tiles[i] = o->banned_tiles[i].tile; |
955 n->ai.banned_val[i] = o->banned_tiles[i].data; |
955 n->ai.banned_val[i] = o->banned_tiles[i].data; |
956 } |
956 } |
957 |
957 |
1096 FixStation(_stations, m->stations, lengthof(m->stations)); |
1096 FixStation(_stations, m->stations, lengthof(m->stations)); |
1097 |
1097 |
1098 FixDepot(_depots, m->depots, lengthof(m->depots)); |
1098 FixDepot(_depots, m->depots, lengthof(m->depots)); |
1099 FixVehicle(_vehicles, m->vehicles, lengthof(m->vehicles)); |
1099 FixVehicle(_vehicles, m->vehicles, lengthof(m->vehicles)); |
1100 FixSubsidy(_subsidies, m->subsidies, lengthof(m->subsidies)); |
1100 FixSubsidy(_subsidies, m->subsidies, lengthof(m->subsidies)); |
1101 |
1101 |
1102 FixPlayer(_players, m->players, lengthof(m->players), m->town_name_type); |
1102 FixPlayer(_players, m->players, lengthof(m->players), m->town_name_type); |
1103 FixName(m->names, lengthof(m->names)); |
1103 FixName(m->names, lengthof(m->names)); |
1104 FixSign(_sign_list, m->signs, lengthof(m->signs)); |
1104 FixSign(_sign_list, m->signs, lengthof(m->signs)); |
1105 FixEngine(_engines, m->engines, lengthof(m->engines)); |
1105 FixEngine(_engines, m->engines, lengthof(m->engines)); |
1106 |
1106 |