From ed8e2bac048a6c4ba73e226b7a8332759bab0697 Mon Sep 17 00:00:00 2001 From: bjarni Date: Sat, 6 Aug 2005 16:07:22 +0000 Subject: (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) --- settings_gui.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'settings_gui.c') 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}, -- cgit v1.2.3-70-g09d2