Changeset - r14510:74c1725726b6
[Not reviewed]
master
0 4 0
rubidium - 15 years ago 2010-02-10 21:28:26
rubidium@openttd.org
(svn r19091) -Cleanup: remove some unneeded zeroing
4 files changed with 2 insertions and 42 deletions:
0 comments (0 inline, 0 general)
src/aircraft_cmd.cpp
Show inline comments
 
@@ -273,7 +273,6 @@ CommandCost CmdBuildAircraft(TileIndex t
 
		v->owner = u->owner = _current_company;
 

	
 
		v->tile = tile;
 
//		u->tile = 0;
 

	
 
		uint x = TileX(tile) * TILE_SIZE + 5;
 
		uint y = TileY(tile) * TILE_SIZE + 3;
 
@@ -284,15 +283,10 @@ CommandCost CmdBuildAircraft(TileIndex t
 
		u->z_pos = GetSlopeZ(x, y);
 
		v->z_pos = u->z_pos + 1;
 

	
 
		v->running_ticks = 0;
 

	
 
//		u->delta_x = u->delta_y = 0;
 

	
 
		v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
 
		u->vehstatus = VS_HIDDEN | VS_UNCLICKABLE | VS_SHADOW;
 

	
 
		v->spritenum = avi->image_index;
 
//		v->cargo_count = u->number_of_pieces = 0;
 

	
 
		v->cargo_cap = avi->passenger_capacity;
 
		u->cargo_cap = avi->mail_capacity;
 
@@ -300,15 +294,8 @@ CommandCost CmdBuildAircraft(TileIndex t
 
		v->cargo_type = e->GetDefaultCargoType();
 
		u->cargo_type = CT_MAIL;
 

	
 
		v->cargo_subtype = 0;
 

	
 
		v->name = NULL;
 
//		v->next_order_param = v->next_order = 0;
 

	
 
//		v->time_counter = 0;
 
//		v->progress = 0;
 
		v->last_station_visited = INVALID_STATION;
 
//		v->destination_coords = 0;
 

	
 
		v->max_speed = avi->max_speed;
 
		v->acceleration = avi->acceleration;
src/roadveh_cmd.cpp
Show inline comments
 
@@ -244,23 +244,13 @@ CommandCost CmdBuildRoadVeh(TileIndex ti
 
		v->y_pos = y;
 
		v->z_pos = GetSlopeZ(x, y);
 

	
 
//		v->running_ticks = 0;
 

	
 
		v->state = RVSB_IN_DEPOT;
 
		v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
 

	
 
		v->spritenum = rvi->image_index;
 
		v->cargo_type = e->GetDefaultCargoType();
 
//		v->cargo_subtype = 0;
 
		v->cargo_cap = rvi->capacity;
 
//		v->cargo_count = 0;
 
		v->value = cost.GetCost();
 
//		v->day_counter = 0;
 
//		v->next_order_param = v->next_order = 0;
 
//		v->time_counter = 0;
 
//		v->progress = 0;
 

	
 
//		v->overtaking = 0;
 

	
 
		v->last_station_visited = INVALID_STATION;
 
		v->max_speed = rvi->max_speed;
 
@@ -272,8 +262,6 @@ CommandCost CmdBuildRoadVeh(TileIndex ti
 
		v->max_age = e->GetLifeLengthInDays();
 
		_new_vehicle_id = v->index;
 

	
 
		v->name = NULL;
 

	
 
		v->service_interval = Company::Get(v->owner)->settings.vehicle.servint_roadveh;
 

	
 
		v->date_of_last_service = _date;
 
@@ -287,7 +275,6 @@ CommandCost CmdBuildRoadVeh(TileIndex ti
 
		v->compatible_roadtypes = RoadTypeToRoadTypes(v->roadtype);
 
		v->rcache.cached_veh_length = 8;
 

	
 
		v->vehicle_flags = 0;
 
		if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
 

	
 
		AddArticulatedParts(v);
src/ship_cmd.cpp
Show inline comments
 
@@ -650,14 +650,11 @@ CommandCost CmdBuildShip(TileIndex tile,
 
		v->y_pos = y;
 
		v->z_pos = GetSlopeZ(x, y);
 

	
 
		v->running_ticks = 0;
 

	
 
		v->UpdateDeltaXY(v->direction);
 
		v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
 

	
 
		v->spritenum = svi->image_index;
 
		v->cargo_type = e->GetDefaultCargoType();
 
		v->cargo_subtype = 0;
 
		v->cargo_cap = svi->capacity;
 
		v->value = value.GetCost();
 

	
 
@@ -670,7 +667,6 @@ CommandCost CmdBuildShip(TileIndex tile,
 
		v->max_age = e->GetLifeLengthInDays();
 
		_new_vehicle_id = v->index;
 

	
 
		v->name = NULL;
 
		v->state = TRACK_BIT_DEPOT;
 

	
 
		v->service_interval = Company::Get(_current_company)->settings.vehicle.servint_ships;
 
@@ -679,7 +675,6 @@ CommandCost CmdBuildShip(TileIndex tile,
 
		v->cur_image = SPR_IMG_QUERY;
 
		v->random_bits = VehicleRandomBits();
 

	
 
		v->vehicle_flags = 0;
 
		if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
 

	
 
		v->InvalidateNewGRFCacheOfChain();
 
@@ -693,8 +688,9 @@ CommandCost CmdBuildShip(TileIndex tile,
 
		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 
		InvalidateWindowClassesData(WC_SHIPS_LIST, 0);
 
		SetWindowDirty(WC_COMPANY, v->owner);
 
		if (IsLocalCompany())
 
		if (IsLocalCompany()) {
 
			InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the replace Ship window
 
		}
 

	
 
		Company::Get(_current_company)->num_engines[p1]++;
 
	}
src/train_cmd.cpp
Show inline comments
 
@@ -710,17 +710,14 @@ static CommandCost CmdBuildRailWagon(Eng
 
		v->track = TRACK_BIT_DEPOT;
 
		v->vehstatus = VS_HIDDEN | VS_DEFPAL;
 

	
 
//		v->subtype = 0;
 
		v->SetWagon();
 

	
 
		v->SetFreeWagon();
 
		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 

	
 
		v->cargo_type = e->GetDefaultCargoType();
 
//		v->cargo_subtype = 0;
 
		v->cargo_cap = rvi->capacity;
 
		v->value = value.GetCost();
 
//		v->day_counter = 0;
 

	
 
		v->railtype = rvi->railtype;
 

	
 
@@ -790,7 +787,6 @@ static void AddRearEngineToMultiheadedTr
 
	u->z_pos = v->z_pos;
 
	u->track = TRACK_BIT_DEPOT;
 
	u->vehstatus = v->vehstatus & ~VS_STOPPED;
 
//	u->subtype = 0;
 
	u->spritenum = v->spritenum + 1;
 
	u->cargo_type = v->cargo_type;
 
	u->cargo_subtype = v->cargo_subtype;
 
@@ -870,17 +866,14 @@ CommandCost CmdBuildRailVehicle(TileInde
 
		v->x_pos = x;
 
		v->y_pos = y;
 
		v->z_pos = GetSlopeZ(x, y);
 
//		v->running_ticks = 0;
 
		v->track = TRACK_BIT_DEPOT;
 
		v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
 
		v->spritenum = rvi->image_index;
 
		v->cargo_type = e->GetDefaultCargoType();
 
//		v->cargo_subtype = 0;
 
		v->cargo_cap = rvi->capacity;
 
		v->max_speed = rvi->max_speed;
 
		v->value = value.GetCost();
 
		v->last_station_visited = INVALID_STATION;
 
//		v->dest_tile = 0;
 

	
 
		v->engine_type = p1;
 
		v->tcache.first_engine = INVALID_ENGINE; // needs to be set before first callback
 
@@ -889,7 +882,6 @@ CommandCost CmdBuildRailVehicle(TileInde
 
		v->reliability_spd_dec = e->reliability_spd_dec;
 
		v->max_age = e->GetLifeLengthInDays();
 

	
 
		v->name = NULL;
 
		v->railtype = rvi->railtype;
 
		_new_vehicle_id = v->index;
 

	
 
@@ -899,12 +891,10 @@ CommandCost CmdBuildRailVehicle(TileInde
 
		v->cur_image = SPR_IMG_QUERY;
 
		v->random_bits = VehicleRandomBits();
 

	
 
//		v->vehicle_flags = 0;
 
		if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
 

	
 
		v->group_id = DEFAULT_GROUP;
 

	
 
//		v->subtype = 0;
 
		v->SetFrontEngine();
 
		v->SetEngine();
 

	
0 comments (0 inline, 0 general)