Changeset - r4737:000dc240da9f
[Not reviewed]
master
0 3 0
peter1138 - 18 years ago 2006-10-05 11:26:59
peter1138@openttd.org
(svn r6649) - Codechange: Show more correct capacity of articulated wagons in the train purchase list.
3 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
train.h
Show inline comments
 
@@ -214,11 +214,12 @@ static inline Vehicle *GetNextVehicle(co
 
	/* v now contains the last artic part in the engine */
 
	return v->next;
 
}
 

	
 
void ConvertOldMultiheadToNew(void);
 
void ConnectMultiheadedTrains(void);
 
uint CountArticulatedParts(EngineID engine_type);
 

	
 
int CheckTrainInDepot(const Vehicle *v, bool needs_to_be_stopped);
 
void CcCloneTrain(bool success, TileIndex tile, uint32 p1, uint32 p2);
 

	
 
#endif /* TRAIN_H */
train_cmd.c
Show inline comments
 
@@ -477,13 +477,13 @@ void DrawTrainEngine(int x, int y, Engin
 
				_engine_sprite_base[img + 1];
 
		}
 
	}
 
	DrawSprite(image | image_ormod, x, y);
 
}
 

	
 
static uint CountArticulatedParts(EngineID engine_type)
 
uint CountArticulatedParts(EngineID engine_type)
 
{
 
	uint16 callback;
 
	uint i;
 

	
 
	if (!HASBIT(EngInfo(engine_type)->callbackmask, CBM_ARTIC_ENGINE)) return 0;
 

	
train_gui.c
Show inline comments
 
@@ -63,13 +63,13 @@ void DrawTrainEnginePurchaseInfo(int x, 
 

	
 
	/* Cargo type + capacity, or N/A */
 
	SetDParam(0, STR_8838_N_A);
 
	SetDParam(2, STR_EMPTY);
 
	if (rvi->capacity != 0) {
 
		SetDParam(0, _cargoc.names_long[rvi->cargo_type]);
 
		SetDParam(1, rvi->capacity << multihead);
 
		SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead);
 
		SetDParam(2, STR_9842_REFITTABLE);
 
	}
 
	DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0);
 
	y += 10;
 

	
 
	/* Design date - Life length */
 
@@ -111,13 +111,13 @@ void DrawTrainWagonPurchaseInfo(int x, i
 

	
 
	/* Cargo type + capacity, or N/A */
 
	SetDParam(0, STR_8838_N_A);
 
	SetDParam(2, STR_EMPTY);
 
	if (rvi->capacity != 0) {
 
		SetDParam(0, _cargoc.names_long[rvi->cargo_type]);
 
		SetDParam(1, rvi->capacity);
 
		SetDParam(1, rvi->capacity * (CountArticulatedParts(engine_number) + 1));
 
		SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
 
	}
 
	DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
 
	y += 10;
 

	
 
	/* Wagon speed limit, displayed if above zero */
0 comments (0 inline, 0 general)