# HG changeset patch # User rubidium # Date 2008-04-12 09:59:58 # Node ID b8b92d97ba9413bac9b1d4fbf57d7a1992527d1c # Parent 715123b2369bf6e201697890bf59961cddfd3a06 (svn r12664) -Codechange: do not force the 'color' pointer to be non-NULL when trying to get the load percentage. diff --git a/src/vehicle.cpp b/src/vehicle.cpp --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2149,8 +2149,6 @@ uint8 CalcPercentVehicleFilled(Vehicle * 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 * } } - 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 */