diff src/graph_gui.cpp @ 10477:20da0dd3f897 draft

(svn r14732) -Codechange: replace some magic number with less magic constants and use the proper type for a few variables.
author rubidium <rubidium@openttd.org>
date Tue, 23 Dec 2008 21:03:43 +0000 (2008-12-23)
parents 39cf8eebfda5
children 649ba332458f
line wrap: on
line diff
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -66,7 +66,7 @@
 
 	virtual void OnClick(Point pt, int widget)
 	{
-		if (!IsInsideMM(widget, 3, 11)) return;
+		if (!IsInsideMM(widget, 3, MAX_COMPANIES + 3)) return;
 
 		ToggleBit(_legend_excluded_companies, widget - 3);
 		this->ToggleWidgetLoweredState(widget);
@@ -859,7 +859,7 @@
 private:
 	enum PerformanteRatingWidgets {
 		PRW_COMPANY_FIRST = 13,
-		PRW_COMPANY_LAST  = 20,
+		PRW_COMPANY_LAST  = PRW_COMPANY_FIRST + MAX_COMPANIES - 1,
 	};
 
 public: