Changeset - r24350:2b062295a732
[Not reviewed]
master
0 1 0
stormcone - 4 years ago 2020-09-25 14:35:48
48624099+stormcone@users.noreply.github.com
Fix 70f9c3c6: The *_filter_criteria variables contain an index, not a cargo. (#8320)
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/industry_gui.cpp
Show inline comments
 
@@ -1254,14 +1254,14 @@ protected:
 

	
 
	CargoID cargo_filter[NUM_CARGO + 2];        ///< Available cargo filters; CargoID or CF_ANY or CF_NONE
 
	StringID cargo_filter_texts[NUM_CARGO + 3]; ///< Texts for filter_cargo, terminated by INVALID_STRING_ID
 
	CargoID produced_cargo_filter_criteria;     ///< Selected produced cargo filter
 
	CargoID accepted_cargo_filter_criteria;     ///< Selected accepted cargo filter
 
	byte produced_cargo_filter_criteria;        ///< Selected produced cargo filter index
 
	byte accepted_cargo_filter_criteria;        ///< Selected accepted cargo filter index
 

	
 
	/**
 
	 * Set cargo filter list item index.
 
	 * @param index The index of the cargo to be set
 
	 */
 
	void SetProducedCargoFilterIndex(int index)
 
	void SetProducedCargoFilterIndex(byte index)
 
	{
 
		if (this->produced_cargo_filter_criteria != index) {
 
			this->produced_cargo_filter_criteria = index;
 
@@ -1278,7 +1278,7 @@ protected:
 
	 * Set cargo filter list item index.
 
	 * @param index The index of the cargo to be set
 
	 */
 
	void SetAcceptedCargoFilterIndex(int index)
 
	void SetAcceptedCargoFilterIndex(byte index)
 
	{
 
		if (this->accepted_cargo_filter_criteria != index) {
 
			this->accepted_cargo_filter_criteria = index;
 
@@ -1296,7 +1296,7 @@ protected:
 
	 */
 
	void SetCargoFilterArray()
 
	{
 
		uint filter_items = 0;
 
		byte filter_items = 0;
 

	
 
		/* Add item for disabling filtering. */
 
		this->cargo_filter[filter_items] = CF_ANY;
0 comments (0 inline, 0 general)