diff --git a/command.c b/command.c index fc6ef7329e..30b0422498 100644 --- a/command.c +++ b/command.c @@ -156,7 +156,7 @@ DEF_COMMAND(CmdRefitRailVehicle); DEF_COMMAND(CmdBuildSignalTrack); DEF_COMMAND(CmdRemoveSignalTrack); -DEF_COMMAND(CmdReplaceVehicle); +DEF_COMMAND(CmdSetAutoReplace); DEF_COMMAND(CmdCloneVehicle); DEF_COMMAND(CmdMassStartStopVehicle); @@ -303,7 +303,7 @@ static const Command _command_proc_table[] = { {NULL, 0}, /* 112 */ {CmdGiveMoney, 0}, /* 113 */ {CmdChangePatchSetting, CMD_SERVER}, /* 114 */ - {CmdReplaceVehicle, 0}, /* 115 */ + {CmdSetAutoReplace, 0}, /* 115 */ {CmdCloneVehicle, 0}, /* 116 */ {CmdMassStartStopVehicle, 0}, /* 117 */ {CmdDepotSellAllVehicles, 0}, /* 118 */ diff --git a/command.h b/command.h index 35eced22b9..cd9f822b43 100644 --- a/command.h +++ b/command.h @@ -133,7 +133,7 @@ enum { CMD_GIVE_MONEY = 113, CMD_CHANGE_PATCH_SETTING = 114, - CMD_REPLACE_VEHICLE = 115, + CMD_SET_AUTOREPLACE = 115, CMD_CLONE_VEHICLE = 116, CMD_MASS_START_STOP = 117, diff --git a/openttd.c b/openttd.c index e48da751f4..eb54886cd4 100644 --- a/openttd.c +++ b/openttd.c @@ -606,7 +606,7 @@ static void MakeNewGameDone(void) _local_player = 0; _current_player = _local_player; - DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE); MarkWholeScreenDirty(); } @@ -681,7 +681,7 @@ static void StartScenario(void) _local_player = 0; _current_player = _local_player; - DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE); MarkWholeScreenDirty(); } diff --git a/players.c b/players.c index 1aed34fb1d..b4a279ab65 100644 --- a/players.c +++ b/players.c @@ -700,7 +700,7 @@ static void DeletePlayerStuff(PlayerID pi) * if p1 = 5, then * - p2 = enable renew_keep_length */ -int32 CmdReplaceVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) +int32 CmdSetAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Player *p; if (!(_current_player < MAX_PLAYERS)) @@ -869,7 +869,7 @@ int32 CmdPlayerCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) MarkWholeScreenDirty(); } } else if (p->index == _local_player) { - DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE); } #ifdef ENABLE_NETWORK if (_network_server) { diff --git a/settings.c b/settings.c index 98dd320363..0b77381cb7 100644 --- a/settings.c +++ b/settings.c @@ -1123,19 +1123,19 @@ static int32 CheckInterval(int32 p1) static int32 EngineRenewUpdate(int32 p1) { - DoCommandP(0, 0, _patches.autorenew, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, 0, _patches.autorenew, NULL, CMD_SET_AUTOREPLACE); return 0; } static int32 EngineRenewMonthsUpdate(int32 p1) { - DoCommandP(0, 1, _patches.autorenew_months, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, 1, _patches.autorenew_months, NULL, CMD_SET_AUTOREPLACE); return 0; } static int32 EngineRenewMoneyUpdate(int32 p1) { - DoCommandP(0, 2, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, 2, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE); return 0; } /* End - Callback Functions */ diff --git a/vehicle_gui.c b/vehicle_gui.c index 21b7531ccd..93b0033889 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -989,19 +989,19 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e) break; case 17: /* toggle renew_keep_length */ - DoCommandP(0, 5, GetPlayer(_local_player)->renew_keep_length ? 0 : 1, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, 5, GetPlayer(_local_player)->renew_keep_length ? 0 : 1, NULL, CMD_SET_AUTOREPLACE); break; case 4: { /* Start replacing */ EngineID veh_from = WP(w, replaceveh_d).sel_engine[0]; EngineID veh_to = WP(w, replaceveh_d).sel_engine[1]; - DoCommandP(0, 3, veh_from + (veh_to << 16), NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, 3, veh_from + (veh_to << 16), NULL, CMD_SET_AUTOREPLACE); break; } case 6: { /* Stop replacing */ EngineID veh_from = WP(w, replaceveh_d).sel_engine[0]; - DoCommandP(0, 3, veh_from + (INVALID_ENGINE << 16), NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, 3, veh_from + (INVALID_ENGINE << 16), NULL, CMD_SET_AUTOREPLACE); break; }