(svn r3051) Remove the unused function RemoteSubsidyAdd()
authortron
Sun, 16 Oct 2005 14:07:11 +0000
changeset 2522 8ca253e76703
parent 2521 4450cdf804f6
child 2523 cab22b46dca9
(svn r3051) Remove the unused function RemoteSubsidyAdd()
ai/default/default.c
economy.c
economy.h
train_cmd.c
vehicle.h
--- a/ai/default/default.c	Sun Oct 16 12:22:16 2005 +0000
+++ b/ai/default/default.c	Sun Oct 16 14:07:11 2005 +0000
@@ -133,12 +133,16 @@
 		const RailVehicleInfo *rvi = RailVehInfo(i);
 		const Engine* e = GetEngine(i);
 
-		if (e->railtype != railtype || rvi->flags & RVI_WAGON
-		    || !HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D)
+		if (e->railtype != railtype ||
+				rvi->flags & RVI_WAGON ||
+				(rvi->flags & RVI_MULTIHEAD && flag & 1) ||
+				!HASBIT(e->player_avail, _current_player) ||
+				e->reliability < 0x8A3D) {
 			continue;
+		}
 
 		ret = DoCommandByTile(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE);
-		if (!CmdFailed(ret) && (!(_cmd_build_rail_veh_var1&1) || !(flag&1)) && ret <= money &&
+		if (!CmdFailed(ret) && ret <= money &&
 				_cmd_build_rail_veh_score >= best_veh_score) {
 			best_veh_score = _cmd_build_rail_veh_score;
 			best_veh_index = i;
--- a/economy.c	Sun Oct 16 12:22:16 2005 +0000
+++ b/economy.c	Sun Oct 16 14:07:11 2005 +0000
@@ -1000,23 +1000,6 @@
 	return false;
 }
 
-void RemoteSubsidyAdd(Subsidy *s_new)
-{
-	Subsidy *s;
-	Pair pair;
-
-	// search the first free subsidy
-	for(s=_subsidies; s != endof(_subsidies); s++)
-		if (s->cargo_type == CT_INVALID)
-			break;
-
-	memcpy(s,s_new,sizeof(Subsidy));
-
-	pair = SetupSubsidyDecodeParam(s, 0);
-	AddNewsItem(STR_2030_SERVICE_SUBSIDY_OFFERED, NEWS_FLAGS(NM_NORMAL, NF_TILE, NT_SUBSIDIES, 0), pair.a, pair.b);
-
-	InvalidateWindow(WC_SUBSIDIES_LIST, 0);
-}
 
 static void SubsidyMonthlyHandler(void)
 {
--- a/economy.h	Sun Oct 16 12:22:16 2005 +0000
+++ b/economy.h	Sun Oct 16 14:07:11 2005 +0000
@@ -63,7 +63,6 @@
 Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode);
 void DeleteSubsidyWithIndustry(uint16 index);
 void DeleteSubsidyWithStation(uint16 index);
-void RemoteSubsidyAdd(Subsidy *s_new);
 
 int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type);
 uint MoveGoodsToStation(TileIndex tile, int w, int h, int type, uint amount);
--- a/train_cmd.c	Sun Oct 16 12:22:16 2005 +0000
+++ b/train_cmd.c	Sun Oct 16 14:07:11 2005 +0000
@@ -498,24 +498,6 @@
 	}
 }
 
-static const byte _railveh_unk1[] = {
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 1, 1, 0, 0, 0,
-	0, 0, 0, 0, 1, 0, 1, 0,
-	0, 1, 1, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 1,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0,
-};
-
 static const byte _railveh_score[] = {
 	1, 4, 7, 19, 20, 30, 31, 19,
 	20, 21, 22, 10, 11, 30, 31, 32,
@@ -590,8 +572,6 @@
 		if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
 	}
 
-	_cmd_build_rail_veh_var1 = 0;
-
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
 	rvi = RailVehInfo(p1);
@@ -676,7 +656,6 @@
 			InvalidateWindow(WC_COMPANY, v->owner);
 		}
 	}
-	_cmd_build_rail_veh_var1 = _railveh_unk1[p1];
 	_cmd_build_rail_veh_score = _railveh_score[p1];
 
 	InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train); // updates the replace Train window
--- a/vehicle.h	Sun Oct 16 12:22:16 2005 +0000
+++ b/vehicle.h	Sun Oct 16 14:07:11 2005 +0000
@@ -447,7 +447,6 @@
 VARDEF VehicleID _new_roadveh_id;
 VARDEF uint16 _aircraft_refit_capacity;
 VARDEF byte _cmd_build_rail_veh_score;
-VARDEF byte _cmd_build_rail_veh_var1;
 
 // for each player, for each vehicle type, keep a list of the vehicles.
 //VARDEF Vehicle *_vehicle_arr[8][4];