Mercurial > hg > openttd
changeset 8897:723bed4b0900 draft
(svn r12664) -Codechange: do not force the 'color' pointer to be non-NULL when trying to get the load percentage.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 12 Apr 2008 09:59:58 +0000 |
parents | 95aa37122b68 |
children | 22854af8a4d0 |
files | src/vehicle.cpp |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2149,8 +2149,6 @@ 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 @@ } } - 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 */