summaryrefslogtreecommitdiff
path: root/src/newgrf_industries.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r--src/newgrf_industries.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index 980059cab..19664fa6d 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -312,12 +312,14 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout
CargoID cargo = GetCargoTranslation(parameter, this->ro.grffile);
int index = this->industry->GetCargoProducedIndex(cargo);
if (index < 0) return 0; // invalid cargo
- if (variable == 0x69) return this->industry->produced_cargo_waiting[index];
- if (variable == 0x6A) return this->industry->this_month_production[index];
- if (variable == 0x6B) return this->industry->this_month_transported[index];
- if (variable == 0x6C) return this->industry->last_month_production[index];
- if (variable == 0x6D) return this->industry->last_month_transported[index];
- NOT_REACHED();
+ switch (variable) {
+ case 0x69: return this->industry->produced_cargo_waiting[index];
+ case 0x6A: return this->industry->this_month_production[index];
+ case 0x6B: return this->industry->this_month_transported[index];
+ case 0x6C: return this->industry->last_month_production[index];
+ case 0x6D: return this->industry->last_month_transported[index];
+ default: NOT_REACHED();
+ }
}