diff options
author | rubidium <rubidium@openttd.org> | 2008-04-12 09:59:58 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-12 09:59:58 +0000 |
commit | 02f8281ce20b808e56b5d6dc188590b1fea03ba2 (patch) | |
tree | e77d4153a138c120f07072a5b15eb29ec3da701e /src | |
parent | 89ff74fa73b68e79c44830d420b69444e51c3b05 (diff) | |
download | openttd-02f8281ce20b808e56b5d6dc188590b1fea03ba2.tar.xz |
(svn r12664) -Codechange: do not force the 'color' pointer to be non-NULL when trying to get the load percentage.
Diffstat (limited to 'src')
-rw-r--r-- | src/vehicle.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index b83f85994..34d7803fe 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2149,8 +2149,6 @@ uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color) int unloading = 0; bool loading = false; - assert(color != NULL); - const Vehicle *u = v; const Station *st = GetStation(v->last_station_visited); @@ -2165,12 +2163,14 @@ uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color) } } - if (unloading == 0 && loading) { - *color = STR_PERCENT_UP; - } else if (cars == unloading || !loading) { - *color = STR_PERCENT_DOWN; - } else { - *color = STR_PERCENT_UP_DOWN; + if (color != NULL) { + if (unloading == 0 && loading) { + *color = STR_PERCENT_UP; + } else if (cars == unloading || !loading) { + *color = STR_PERCENT_DOWN; + } else { + *color = STR_PERCENT_UP_DOWN; + } } /* Train without capacity */ |