(svn r12664) -Codechange: do not force the 'color' pointer to be non-NULL when trying to get the load percentage.

This commit is contained in:
rubidium 2008-04-12 09:59:58 +00:00
parent 00d23c57b3
commit 8226c92c8a
1 changed files with 8 additions and 8 deletions

View File

@ -2149,8 +2149,6 @@ uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color)
int unloading = 0; int unloading = 0;
bool loading = false; bool loading = false;
assert(color != NULL);
const Vehicle *u = v; const Vehicle *u = v;
const Station *st = GetStation(v->last_station_visited); const Station *st = GetStation(v->last_station_visited);
@ -2165,6 +2163,7 @@ uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color)
} }
} }
if (color != NULL) {
if (unloading == 0 && loading) { if (unloading == 0 && loading) {
*color = STR_PERCENT_UP; *color = STR_PERCENT_UP;
} else if (cars == unloading || !loading) { } else if (cars == unloading || !loading) {
@ -2172,6 +2171,7 @@ uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color)
} else { } else {
*color = STR_PERCENT_UP_DOWN; *color = STR_PERCENT_UP_DOWN;
} }
}
/* Train without capacity */ /* Train without capacity */
if (max == 0) return 100; if (max == 0) return 100;