@@ -45,27 +45,26 @@ static void StationsWndShowStationRating
}
static SortStruct _station_sort[lengthof(_stations)];
static uint16 _num_station_sort[MAX_PLAYERS];
static char _bufcache[64];
static uint16 _last_station_idx;
static int CDECL StationNameSorter(const void *a, const void *b)
{
char buf1[64];
Station *st;
SortStruct *cmp1, *cmp2;
cmp1 = (SortStruct*)a;
cmp2 = (SortStruct*)b;
const SortStruct *cmp1 = (const SortStruct*)a;
const SortStruct *cmp2 = (const SortStruct*)b;
st = DEREF_STATION(cmp1->index);
SET_DPARAM16(0, st->town->townnametype);
SET_DPARAM32(1, st->town->townnameparts);
GetString(buf1, st->string_id);
if ( cmp2->index != _last_station_idx) {
_last_station_idx = cmp2->index;
st = DEREF_STATION(cmp2->index);
GetString(_bufcache, st->string_id);