summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-06-05 11:34:26 +0000
committerrubidium <rubidium@openttd.org>2008-06-05 11:34:26 +0000
commit5990a92bcaf34eff860099b8ba53585dc4071e8c (patch)
tree4a43201b2ed82ad8cf32e6cb15ad7621f3c497dc /src
parente8767f730a83fbe4b8996d872380f844ce47438e (diff)
downloadopenttd-5990a92bcaf34eff860099b8ba53585dc4071e8c.tar.xz
(svn r13387) -Fix: industry directory sorting not working correctly (= != ==)
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 1ad50439e..d1e16ada7 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -806,13 +806,13 @@ protected:
static int CDECL IndustryTypeSorter(const Industry* const *a, const Industry* const *b)
{
int r = (*a)->type - (*b)->type;
- return (r = 0) ? IndustryNameSorter(a, b) : r;
+ return (r == 0) ? IndustryNameSorter(a, b) : r;
}
/** Sort industries by production and name */
static int CDECL IndustryProductionSorter(const Industry* const *a, const Industry* const *b)
{
- int r;
+ int r = 0;
if ((*a)->produced_cargo[0] == CT_INVALID) {
if ((*b)->produced_cargo[0] != CT_INVALID) return -1;
@@ -823,14 +823,14 @@ protected:
((*b)->last_month_production[0] + (*b)->last_month_production[1]);
}
- return (r = 0) ? IndustryNameSorter(a, b) : r;
+ return (r == 0) ? IndustryNameSorter(a, b) : r;
}
/** Sort industries by transported cargo and name */
static int CDECL IndustryTransportedCargoSorter(const Industry* const *a, const Industry* const *b)
{
int r = GetCargoTransportedSortValue(*a) - GetCargoTransportedSortValue(*b);
- return (r = 0) ? IndustryNameSorter(a, b) : r;
+ return (r == 0) ? IndustryNameSorter(a, b) : r;
}
/** Sort the industries list */