diff options
author | frosch <frosch@openttd.org> | 2011-11-08 17:26:13 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-08 17:26:13 +0000 |
commit | b98c7763de42eda4b3d19604bc3f33452b9b05e4 (patch) | |
tree | 3a0092e76fa25fd7d025cefe8e105875b99c5c8f /src/industry_gui.cpp | |
parent | b374b92bfb06745d21701d398bb0c78a395498b4 (diff) | |
download | openttd-b98c7763de42eda4b3d19604bc3f33452b9b05e4.tar.xz |
(svn r23146) -Change: [NewGRF v8] Make callback 22 return a probability to use instead of property 18.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 1ea3967fd..9c2e825f6 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -209,7 +209,7 @@ class BuildIndustryWindow : public Window { bool timer_enabled; ///< timer can be used uint16 count; ///< How many industries are loaded IndustryType index[NUM_INDUSTRYTYPES + 1]; ///< Type of industry, in the order it was loaded - bool enabled[NUM_INDUSTRYTYPES + 1]; ///< availability state, coming from CBID_INDUSTRY_AVAILABLE (if ever) + bool enabled[NUM_INDUSTRYTYPES + 1]; ///< availability state, coming from CBID_INDUSTRY_PROBABILITY (if ever) Scrollbar *vscroll; /** The offset for the text in the matrix. */ @@ -247,7 +247,7 @@ class BuildIndustryWindow : public Window { continue; } this->index[this->count] = ind; - this->enabled[this->count] = (_game_mode == GM_EDITOR) || CheckIfCallBackAllowsAvailability(ind, IACT_USERCREATION); + this->enabled[this->count] = (_game_mode == GM_EDITOR) || GetIndustryProbabilityCallback(ind, IACT_USERCREATION, 1) > 0; /* Keep the selection to the correct line */ if (this->selected_type == ind) this->selected_index = this->count; this->count++; @@ -582,7 +582,7 @@ public: const IndustrySpec *indsp = GetIndustrySpec(this->selected_type); if (indsp->enabled) { - bool call_back_result = CheckIfCallBackAllowsAvailability(this->selected_type, IACT_USERCREATION); + bool call_back_result = GetIndustryProbabilityCallback(this->selected_type, IACT_USERCREATION, 1) > 0; /* Only if result does match the previous state would it require a redraw. */ if (call_back_result != this->enabled[this->selected_index]) { |