diff options
author | rubidium <rubidium@openttd.org> | 2008-12-23 21:03:43 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-23 21:03:43 +0000 |
commit | c3746a55bbee5d1b752411480a6e1abfe0413870 (patch) | |
tree | 13bdd9c673e98449442640715abe78de2b568a5e | |
parent | ece37ca2c095ff672cd9f6e793da865c9029c83c (diff) | |
download | openttd-c3746a55bbee5d1b752411480a6e1abfe0413870.tar.xz |
(svn r14732) -Codechange: replace some magic number with less magic constants and use the proper type for a few variables.
-rw-r--r-- | src/engine.cpp | 2 | ||||
-rw-r--r-- | src/graph_gui.cpp | 4 | ||||
-rw-r--r-- | src/settings.cpp | 2 | ||||
-rw-r--r-- | src/town.h | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index f24574a94..3d0907bfb 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -315,7 +315,7 @@ static CompanyID GetBestCompany(uint8 pp) const Company *c; int32 best_hist; CompanyID best_company; - uint mask = 0; + CompanyMask mask = 0; do { best_hist = -1; diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 199248cd4..1f9bcf973 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -66,7 +66,7 @@ struct GraphLegendWindow : Window { 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 @@ struct PerformanceRatingDetailWindow : Window { private: enum PerformanteRatingWidgets { PRW_COMPANY_FIRST = 13, - PRW_COMPANY_LAST = 20, + PRW_COMPANY_LAST = PRW_COMPANY_FIRST + MAX_COMPANIES - 1, }; public: diff --git a/src/settings.cpp b/src/settings.cpp index 4fe78d398..0636d0f52 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1234,7 +1234,7 @@ const SettingDesc _patch_settings[] = { /***************************************************************************/ /* Saved patch variables. */ /* Do not ADD or REMOVE something in this "difficulty.XXX" table or before it. It breaks savegame compatability. */ - SDT_CONDVAR(GameSettings, difficulty.max_no_competitors, SLE_UINT8, 97, SL_MAX_VERSION, 0, 0, 2, 0, 7, 1, STR_NULL, DifficultyChange), + SDT_CONDVAR(GameSettings, difficulty.max_no_competitors, SLE_UINT8, 97, SL_MAX_VERSION, 0, 0, 2,0,MAX_COMPANIES-1,1,STR_NULL, DifficultyChange), SDT_CONDVAR(GameSettings, difficulty.competitor_start_time, SLE_UINT8, 97, SL_MAX_VERSION, 0,NG, 2, 0, 3, 1, STR_6830_IMMEDIATE, DifficultyChange), SDT_CONDVAR(GameSettings, difficulty.number_towns, SLE_UINT8, 97, SL_MAX_VERSION, 0,NG, 2, 0, 3, 1, STR_NUM_VERY_LOW, DifficultyChange), SDT_CONDVAR(GameSettings, difficulty.number_industries, SLE_UINT8, 97, SL_MAX_VERSION, 0,NG, 4, 0, 4, 1, STR_NONE, DifficultyChange), diff --git a/src/town.h b/src/town.h index ad63594df..f7f584b86 100644 --- a/src/town.h +++ b/src/town.h @@ -122,7 +122,7 @@ struct Town : PoolItem<Town, TownID, &_Town_pool> { uint16 noise_reached; /* Which companies have a statue? */ - byte statues; + CompanyMask statues; /* Company ratings as well as a mask that determines which companies have a rating. */ CompanyMask have_ratings; |