Changeset - r4836:47fab20f68b2
[Not reviewed]
master
0 1 0
Darkvater - 18 years ago 2006-10-12 15:39:33
darkvater@openttd.org
(svn r6760) -Codechange: Do a case insensitive sort of train engine names and just normally
check a boolean; no special magic needed
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
train_gui.c
Show inline comments
 
@@ -141,20 +141,20 @@ static int CDECL TrainEngineNameSorter(c
 
		_last_engine = vb;
 
		_bufcache[0] = '\0';
 

	
 
		GetString(_bufcache, GetCustomEngineName(vb));
 
	}
 

	
 
	r =  strcmp(buf1, _bufcache); // sort by name
 
	r =  strcasecmp(buf1, _bufcache); // sort by name
 

	
 
	if (r == 0) {
 
		/* Use EngineID to sort instead since we want consistent sorting */
 
		return TrainEngineNumberSorter(a, b);
 
	}
 

	
 
	return (_internal_sort_order & 1) ? -r : r;
 
	return _internal_sort_order ? -r : r;
 
}
 

	
 
static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b)
 
{
 
	const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a);
 
	const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b);
0 comments (0 inline, 0 general)