(svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
authorfrosch
Sat, 26 Jul 2008 22:00:59 +0000
changeset 9720 2a0354eea879
parent 9719 15e207edea1a
child 9721 b6441d53c221
(svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
src/engine_gui.cpp
src/engine_type.h
--- a/src/engine_gui.cpp	Sat Jul 26 17:55:49 2008 +0000
+++ b/src/engine_gui.cpp	Sat Jul 26 22:00:59 2008 +0000
@@ -137,15 +137,15 @@
 
 	SetDParam(0, (_price.build_railvehicle >> 3) * GetEngineProperty(engine, 0x17, rvi->base_cost) >> 5);
 	SetDParam(2, GetEngineProperty(engine, 0x09, rvi->max_speed) * 10 / 16);
-	SetDParam(3, GetEngineProperty(engine, 0x0B, rvi->power) << multihead);
+	SetDParam(3, GetEngineProperty(engine, 0x0B, rvi->power));
 	SetDParam(1, GetEngineProperty(engine, 0x16, rvi->weight) << multihead);
 
-	SetDParam(4, GetEngineProperty(engine, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8 << multihead);
+	SetDParam(4, GetEngineProperty(engine, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8);
 
 	uint capacity = GetTotalCapacityOfArticulatedParts(engine, VEH_TRAIN);
 	if (capacity != 0) {
 		SetDParam(5, rvi->cargo_type);
-		SetDParam(6, capacity << multihead);
+		SetDParam(6, capacity);
 	} else {
 		SetDParam(5, CT_INVALID);
 	}
--- a/src/engine_type.h	Sat Jul 26 17:55:49 2008 +0000
+++ b/src/engine_type.h	Sat Jul 26 22:00:59 2008 +0000
@@ -36,15 +36,15 @@
 struct RailVehicleInfo {
 	byte image_index;
 	RailVehicleTypes railveh_type;
-	byte base_cost;
+	byte base_cost;                 ///< Purchase cost factor;      For multiheaded engines the sum of both engine prices.
 	RailTypeByte railtype;
 	uint16 max_speed;
-	uint16 power;
-	uint16 weight;
-	byte running_cost;
+	uint16 power;                   ///< Power of engine;           For multiheaded engines the sum of both engine powers.
+	uint16 weight;                  ///< Weight of vehicle;         For multiheaded engines the weight of each single engine.
+	byte running_cost;              ///< Running cost of engine;    For multiheaded engines the sum of both running costs.
 	byte running_cost_class;
 	EngineClass engclass;           ///< Class of engine for this vehicle
-	byte capacity;
+	byte capacity;                  ///< Cargo capacity of vehicle; For multiheaded engines the capacity of each single engine.
 	CargoID cargo_type;
 	byte ai_rank;
 	byte ai_passenger_only; ///< Bit value to tell AI that this engine is for passenger use only