summaryrefslogtreecommitdiff
path: root/settings_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-08-06 16:07:22 +0000
committerbjarni <bjarni@openttd.org>2005-08-06 16:07:22 +0000
commited8e2bac048a6c4ba73e226b7a8332759bab0697 (patch)
tree4628a0df8999b185f9edb643da5024f1ae22e3bc /settings_gui.c
parentddb58492f300333751d4054e3555845ddc3df307 (diff)
downloadopenttd-ed8e2bac048a6c4ba73e226b7a8332759bab0697.tar.xz
(svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to serverside
-This means that one company can only have one setting for renew and replacing more clients will not fight due to different settings anymore -This is a needed step in the line to fix autoreplacing dualheaded locomotives NOTE: savegame revision bump (peter1138 + me in coop)
Diffstat (limited to 'settings_gui.c')
-rw-r--r--settings_gui.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/settings_gui.c b/settings_gui.c
index 6d50c7259..8fce9348e 100644
--- a/settings_gui.c
+++ b/settings_gui.c
@@ -618,6 +618,24 @@ static int32 CheckInterval(int32 p1)
return InValidateDetailsWindow(0);
}
+static int32 EngineRenewUpdate(int32 p1)
+{
+ DoCommandP(0, 0, _patches.autorenew, NULL, CMD_REPLACE_VEHICLE);
+ return 0;
+}
+
+static int32 EngineRenewMonthsUpdate(int32 p1)
+{
+ DoCommandP(0, 1, _patches.autorenew_months, NULL, CMD_REPLACE_VEHICLE);
+ return 0;
+}
+
+static int32 EngineRenewMoneyUpdate(int32 p1)
+{
+ DoCommandP(0, 2, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE);
+ return 0;
+}
+
typedef int32 PatchButtonClick(int32);
typedef struct PatchEntry {
@@ -688,9 +706,9 @@ static const PatchEntry _patches_vehicles[] = {
{PE_BOOL, 0, STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES, "never_expire_vehicles", &_patches.never_expire_vehicles,0,0,0, NULL},
{PE_UINT16, PF_0ISDIS | PF_PLAYERBASED, STR_CONFIG_PATCHES_LOST_TRAIN_DAYS, "lost_train_days", &_patches.lost_train_days, 180,720, 60, NULL},
- {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_VEHICLE,"autorenew", &_patches.autorenew, 0, 0, 0, NULL},
- {PE_INT16, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_MONTHS, "autorenew_months", &_patches.autorenew_months, -12, 12, 1, NULL},
- {PE_CURRENCY, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_MONEY,"autorenew_money", &_patches.autorenew_money, 0, 2000000, 100000, NULL},
+ {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_VEHICLE, "autorenew", &_patches.autorenew, 0, 0, 0, &EngineRenewUpdate},
+ {PE_INT16, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_MONTHS, "autorenew_months", &_patches.autorenew_months, -12, 12, 1, &EngineRenewMonthsUpdate},
+ {PE_CURRENCY, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_MONEY, "autorenew_money", &_patches.autorenew_money, 0, 2000000, 100000, &EngineRenewMoneyUpdate},
{PE_UINT16, 0, STR_CONFIG_PATCHES_MAX_TRAINS, "max_trains", &_patches.max_trains, 0,5000, 50, NULL},
{PE_UINT16, 0, STR_CONFIG_PATCHES_MAX_ROADVEH, "max_roadveh", &_patches.max_roadveh, 0,5000, 50, NULL},