diff src/graph_gui.cpp @ 11949:c89301974eb8 draft

(svn r16352) -Codechange: use PoolItem::GetIfValid() instead of PoolItem::IsValidID() and PoolItem::Get()
author smatz <smatz@openttd.org>
date Mon, 18 May 2009 16:21:28 +0000
parents fccc9cea27a7
children 0f1b20a70f70
line wrap: on
line diff
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -425,8 +425,8 @@
 
 		int numd = 0;
 		for (CompanyID k = COMPANY_FIRST; k < MAX_COMPANIES; k++) {
-			if (Company::IsValidID(k)) {
-				c = Company::Get(k);
+			c = Company::GetIfValid(k);
+			if (c != NULL) {
 				this->colours[numd] = _colour_gradient[c->colour][6];
 				for (int j = this->num_on_x_axis, i = 0; --j >= 0;) {
 					this->cost[numd][i] = (j >= c->num_valid_stat_ent) ? INVALID_DATAPOINT : GetGraphData(c, j);