(svn r12664) -Codechange: do not force the 'color' pointer to be non-NULL when trying to get the load percentage.
authorrubidium
Sat, 12 Apr 2008 09:59:58 +0000
changeset 8897 d53dbad308cc
parent 8896 8ffef4030fe1
child 8898 f8b701997c01
(svn r12664) -Codechange: do not force the 'color' pointer to be non-NULL when trying to get the load percentage.
src/vehicle.cpp
--- a/src/vehicle.cpp	Fri Apr 11 21:19:03 2008 +0000
+++ b/src/vehicle.cpp	Sat Apr 12 09:59:58 2008 +0000
@@ -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 */