Merge branch 'master' into jgrpp
# Conflicts: # src/core/alloc_type.hpp # src/group_gui.cpp # src/newgrf.cpp # src/saveload/economy_sl.cpp # src/saveload/map_sl.cpp # src/station_cmd.cpp
This commit is contained in:
@@ -1429,15 +1429,15 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
|
||||
|
||||
private:
|
||||
/** Sort grfs by name. */
|
||||
static int CDECL NameSorter(const GRFConfig * const *a, const GRFConfig * const *b)
|
||||
static bool NameSorter(const GRFConfig * const &a, const GRFConfig * const &b)
|
||||
{
|
||||
int i = strnatcmp((*a)->GetName(), (*b)->GetName(), true); // Sort by name (natural sorting).
|
||||
if (i != 0) return i;
|
||||
int i = strnatcmp(a->GetName(), b->GetName(), true); // Sort by name (natural sorting).
|
||||
if (i != 0) return i < 0;
|
||||
|
||||
i = (*a)->version - (*b)->version;
|
||||
if (i != 0) return i;
|
||||
i = a->version - b->version;
|
||||
if (i != 0) return i < 0;
|
||||
|
||||
return memcmp((*a)->ident.md5sum, (*b)->ident.md5sum, lengthof((*b)->ident.md5sum));
|
||||
return memcmp(a->ident.md5sum, b->ident.md5sum, lengthof(b->ident.md5sum)) < 0;
|
||||
}
|
||||
|
||||
/** Filter grfs by tags/name */
|
||||
|
Reference in New Issue
Block a user