12 #include "../stdafx.h"
13 #include "../company_func.h"
14 #include "../company_manager_face.h"
16 #include "../tunnelbridge_map.h"
17 #include "../tunnelbridge.h"
18 #include "../station_base.h"
22 #include "table/strings.h"
24 #include "../safeguards.h"
62 uint lips =
GB(face, 10, 4);
68 lips = lips * 15 / 16;
76 uint nose =
GB(face, 13, 3);
78 nose = (nose * 3 >> 3) * 3 >> 2;
85 uint tie_earring =
GB(face, 24, 4);
103 FOR_ALL_STATIONS(st) {
148 case STATION_WAYPOINT:
153 case STATION_TRUCK: {
199 if (tile < other_end) {
241 static const SaveLoad _company_desc[] = {
299 static const SaveLoad _company_settings_desc[] = {
320 static const SaveLoad _company_settings_skip_desc[] = {
342 static const SaveLoad _company_economy_desc[] = {
363 static const SaveLoad _company_ai_desc[] = {
394 static const SaveLoad _company_ai_build_rec_desc[] = {
403 static const SaveLoad _company_livery_desc[] = {
416 SlObject(c, _company_settings_desc);
419 SlObject(¬hing, _company_settings_skip_desc);
427 SlObject(&old_ai, _company_ai_desc);
428 for (i = 0; i != old_ai.num_build_rec; i++) {
429 SlObject(¬hing, _company_ai_build_rec_desc);
445 for (i = 0; i < num_liveries; i++) {
446 SlObject(&c->livery[i], _company_livery_desc);
449 if (num_liveries < LS_END) {
451 memmove(&c->livery[LS_FREIGHT_WAGON], &c->livery[LS_PASSENGER_WAGON_MONORAIL], (LS_END - LS_FREIGHT_WAGON) *
sizeof(c->livery[0]));
452 c->livery[LS_PASSENGER_WAGON_MONORAIL] = c->livery[LS_MONORAIL];
453 c->livery[LS_PASSENGER_WAGON_MAGLEV] = c->livery[LS_MAGLEV];
456 if (num_liveries == LS_END - 4) {
458 c->livery[LS_PASSENGER_TRAM] = c->livery[LS_BUS];
459 c->livery[LS_FREIGHT_TRAM] = c->livery[LS_TRUCK];
464 for (i = 0; i < num_liveries; i++) {
465 SlObject(&dummy_livery, _company_livery_desc);
470 static void SaveLoad_PLYR(
Company *c)
472 SaveLoad_PLYR_common(c, c);
475 static void Save_PLYR()
478 FOR_ALL_COMPANIES(c) {
479 SlSetArrayIndex(c->
index);
484 static void Load_PLYR()
494 static void Check_PLYR()
499 memset(cprops, 0,
sizeof(*cprops));
500 SaveLoad_PLYR_common(NULL, cprops);
504 if (
GB(cprops->
name_1, 11, 5) == 15) {
505 cprops->
name_1 = STR_GAME_SAVELOAD_NOT_AVAILABLE;
513 if (cprops->
name == NULL && !
IsInsideMM(cprops->
name_1, SPECSTR_COMPANY_NAME_START, SPECSTR_COMPANY_NAME_LAST + 1) &&
514 cprops->
name_1 != STR_GAME_SAVELOAD_NOT_AVAILABLE && cprops->
name_1 != STR_SV_UNNAMED &&
515 cprops->
name_1 != SPECSTR_ANDCO_NAME && cprops->
name_1 != SPECSTR_PRESIDENT_NAME &&
516 cprops->
name_1 != SPECSTR_SILLY_NAME) {
517 cprops->
name_1 = STR_GAME_SAVELOAD_NOT_AVAILABLE;
524 static void Ptrs_PLYR()
527 FOR_ALL_COMPANIES(c) {
528 SlObject(c, _company_settings_desc);
534 {
'PLYR', Save_PLYR, Load_PLYR, Ptrs_PLYR, Check_PLYR, CH_ARRAY |
CH_LAST},