summaryrefslogtreecommitdiff
path: root/src/saveload/compat/company_sl_compat.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-06-07 11:35:21 +0200
committerPatric Stout <github@truebrain.nl>2021-07-02 22:21:58 +0200
commit3826703bc3807c8af7372b550760fcd8286b9a6c (patch)
treefdb2aa3b283050d4f9f94325e5df5794d851c124 /src/saveload/compat/company_sl_compat.h
parentcdb3dd0493749dd5c62378f318ea61bcb85f988f (diff)
downloadopenttd-3826703bc3807c8af7372b550760fcd8286b9a6c.tar.xz
Add: store headers for chunks with SL_STRUCTLIST
Diffstat (limited to 'src/saveload/compat/company_sl_compat.h')
-rw-r--r--src/saveload/compat/company_sl_compat.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/src/saveload/compat/company_sl_compat.h b/src/saveload/compat/company_sl_compat.h
new file mode 100644
index 000000000..9da01d3a4
--- /dev/null
+++ b/src/saveload/compat/company_sl_compat.h
@@ -0,0 +1,129 @@
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file company_sl_compat.h Loading of company chunks before table headers were added. */
+
+#ifndef SAVELOAD_COMPAT_COMPANY_H
+#define SAVELOAD_COMPAT_COMPANY_H
+
+#include "../saveload.h"
+
+/** Original field order for SlCompanyOldAIBuildRec. */
+const SaveLoadCompat _company_old_ai_buildrec_compat[] = {
+ SLC_NULL(2, SL_MIN_VERSION, SLV_6),
+ SLC_NULL(4, SLV_6, SLV_107),
+ SLC_NULL(2, SL_MIN_VERSION, SLV_6),
+ SLC_NULL(4, SLV_6, SLV_107),
+ SLC_NULL(8, SL_MIN_VERSION, SLV_107),
+};
+
+/** Original field order for SlCompanyOldAI. */
+const SaveLoadCompat _company_old_ai_compat[] = {
+ SLC_NULL(2, SL_MIN_VERSION, SLV_107),
+ SLC_NULL(2, SL_MIN_VERSION, SLV_13),
+ SLC_NULL(4, SLV_13, SLV_107),
+ SLC_NULL(8, SL_MIN_VERSION, SLV_107),
+ SLC_VAR("num_build_rec"),
+ SLC_NULL(3, SL_MIN_VERSION, SLV_107),
+
+ SLC_NULL(2, SL_MIN_VERSION, SLV_6),
+ SLC_NULL(4, SLV_6, SLV_107),
+ SLC_NULL(2, SL_MIN_VERSION, SLV_6),
+ SLC_NULL(4, SLV_6, SLV_107),
+ SLC_NULL(2, SL_MIN_VERSION, SLV_107),
+
+ SLC_NULL(2, SL_MIN_VERSION, SLV_6),
+ SLC_NULL(4, SLV_6, SLV_107),
+ SLC_NULL(2, SL_MIN_VERSION, SLV_6),
+ SLC_NULL(4, SLV_6, SLV_107),
+ SLC_NULL(2, SL_MIN_VERSION, SLV_107),
+
+ SLC_NULL(2, SL_MIN_VERSION, SLV_69),
+ SLC_NULL(4, SLV_69, SLV_107),
+
+ SLC_NULL(18, SL_MIN_VERSION, SLV_107),
+ SLC_NULL(20, SL_MIN_VERSION, SLV_107),
+ SLC_NULL(32, SL_MIN_VERSION, SLV_107),
+
+ SLC_NULL(64, SLV_2, SLV_107),
+ SLC_VAR("buildrec"),
+};
+
+/** Original field order for SlCompanySettings. */
+const SaveLoadCompat _company_settings_compat[] = {
+ SLC_NULL(512, SLV_16, SLV_19),
+ SLC_VAR("engine_renew_list"),
+ SLC_VAR("settings.engine_renew"),
+ SLC_VAR("settings.engine_renew_months"),
+ SLC_VAR("settings.engine_renew_money"),
+ SLC_VAR("settings.renew_keep_length"),
+ SLC_VAR("settings.vehicle.servint_ispercent"),
+ SLC_VAR("settings.vehicle.servint_trains"),
+ SLC_VAR("settings.vehicle.servint_roadveh"),
+ SLC_VAR("settings.vehicle.servint_aircraft"),
+ SLC_VAR("settings.vehicle.servint_ships"),
+ SLC_NULL(63, SLV_2, SLV_144),
+};
+
+/** Original field order for SlCompanyEconomy. */
+const SaveLoadCompat _company_economy_compat[] = {
+ SLC_VAR("income"),
+ SLC_VAR("expenses"),
+ SLC_VAR("company_value"),
+ SLC_VAR("delivered_cargo[NUM_CARGO - 1]"),
+ SLC_VAR("delivered_cargo"),
+ SLC_VAR("performance_history"),
+};
+
+/** Original field order for SlCompanyLiveries. */
+const SaveLoadCompat _company_liveries_compat[] = {
+ SLC_VAR("in_use"),
+ SLC_VAR("colour1"),
+ SLC_VAR("colour2"),
+};
+
+/** Original field order for company_desc. */
+const SaveLoadCompat _company_sl_compat[] = {
+ SLC_VAR("name_2"),
+ SLC_VAR("name_1"),
+ SLC_VAR("name"),
+ SLC_VAR("president_name_1"),
+ SLC_VAR("president_name_2"),
+ SLC_VAR("president_name"),
+ SLC_VAR("face"),
+ SLC_VAR("money"),
+ SLC_VAR("current_loan"),
+ SLC_VAR("colour"),
+ SLC_VAR("money_fraction"),
+ SLC_NULL(1, SL_MIN_VERSION, SLV_58),
+ SLC_VAR("block_preview"),
+ SLC_NULL(2, SL_MIN_VERSION, SLV_94),
+ SLC_NULL(4, SLV_94, SLV_170),
+ SLC_VAR("location_of_HQ"),
+ SLC_VAR("last_build_coordinate"),
+ SLC_VAR("inaugurated_year"),
+ SLC_VAR("share_owners"),
+ SLC_VAR("num_valid_stat_ent"),
+ SLC_VAR("months_of_bankruptcy"),
+ SLC_VAR("bankrupt_asked"),
+ SLC_VAR("bankrupt_timeout"),
+ SLC_VAR("bankrupt_value"),
+ SLC_VAR("yearly_expenses"),
+ SLC_VAR("is_ai"),
+ SLC_NULL(1, SLV_107, SLV_112),
+ SLC_NULL(1, SLV_4, SLV_100),
+ SLC_VAR("terraform_limit"),
+ SLC_VAR("clear_limit"),
+ SLC_VAR("tree_limit"),
+ SLC_VAR("settings"),
+ SLC_VAR("old_ai"),
+ SLC_VAR("cur_economy"),
+ SLC_VAR("old_economy"),
+ SLC_VAR("liveries"),
+};
+
+#endif /* SAVELOAD_COMPAT_COMPANY_H */