Changeset - r14213:f6ed1a0100e4
[Not reviewed]
master
0 1 0
frosch - 14 years ago 2010-01-10 20:33:10
frosch@openttd.org
(svn r18774) -Change: Consider callback 19 only broken after subcargos 0 to 255 have been used, instead of stopping at 15.
1 file changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/vehicle_gui.cpp
Show inline comments
 
@@ -156,8 +156,8 @@ static void DrawVehicleProfitButton(cons
 
	DrawSprite(SPR_BLOT, pal, x, y);
 
}
 

	
 
/** Maximum number of refit cycles we try, to prevent infinite loops. */
 
static const int MAX_REFIT_CYCLE = 16;
 
/** Maximum number of refit cycles we try, to prevent infinite loops. And we store only a byte anyway */
 
static const uint MAX_REFIT_CYCLE = 256;
 

	
 
/**
 
 * Get the best fitting subtype when 'cloning'/'replacing' v_from with v_for.
 
@@ -193,7 +193,7 @@ byte GetBestFittingSubType(Vehicle *v_fr
 
	v_for->cargo_type = v_from->cargo_type;
 

	
 
	/* Cycle through the refits */
 
	for (byte refit_cyc = 0; refit_cyc < MAX_REFIT_CYCLE; refit_cyc++) {
 
	for (uint refit_cyc = 0; refit_cyc < MAX_REFIT_CYCLE; refit_cyc++) {
 
		v_for->cargo_subtype = refit_cyc;
 

	
 
		/* Make sure we don't pick up anything cached. */
 
@@ -262,11 +262,10 @@ static RefitList *BuildRefitList(const V
 
				 * changed to test the cargo & subtype... */
 
				CargoID temp_cargo = u->cargo_type;
 
				byte temp_subtype  = u->cargo_subtype;
 
				byte refit_cyc;
 

	
 
				u->cargo_type = cid;
 

	
 
				for (refit_cyc = 0; refit_cyc < MAX_REFIT_CYCLE && num_lines < max_lines; refit_cyc++) {
 
				for (uint refit_cyc = 0; refit_cyc < MAX_REFIT_CYCLE && num_lines < max_lines; refit_cyc++) {
 
					bool duplicate = false;
 
					uint16 callback;
 

	
0 comments (0 inline, 0 general)