src/industry_cmd.cpp
changeset 6247 7d81e3a5d803
parent 6201 bee01dc45e39
child 6266 fd42b0893130
equal deleted inserted replaced
6246:75451000349d 6247:7d81e3a5d803
   983 			ChopLumberMillTrees(i);
   983 			ChopLumberMillTrees(i);
   984 		}
   984 		}
   985 	}
   985 	}
   986 }
   986 }
   987 
   987 
   988 void OnTick_Industry(void)
   988 void OnTick_Industry()
   989 {
   989 {
   990 	Industry *i;
   990 	Industry *i;
   991 
   991 
   992 	if (_industry_sound_ctr != 0) {
   992 	if (_industry_sound_ctr != 0) {
   993 		_industry_sound_ctr++;
   993 		_industry_sound_ctr++;
  1353 		}
  1353 		}
  1354 	}
  1354 	}
  1355 	return true;
  1355 	return true;
  1356 }
  1356 }
  1357 
  1357 
  1358 static Industry *AllocateIndustry(void)
  1358 static Industry *AllocateIndustry()
  1359 {
  1359 {
  1360 	Industry *i;
  1360 	Industry *i;
  1361 
  1361 
  1362 	/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
  1362 	/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
  1363 	 * TODO - This is just a temporary stage, this will be removed. */
  1363 	 * TODO - This is just a temporary stage, this will be removed. */
  1580 
  1580 
  1581 		_current_player = old_player;
  1581 		_current_player = old_player;
  1582 	}
  1582 	}
  1583 }
  1583 }
  1584 
  1584 
  1585 void GenerateIndustries(void)
  1585 void GenerateIndustries()
  1586 {
  1586 {
  1587 	const byte *b;
  1587 	const byte *b;
  1588 	uint i = 0;
  1588 	uint i = 0;
  1589 
  1589 
  1590 	/* Find the total amount of industries */
  1590 	/* Find the total amount of industries */
  1822 		SetDParam(0, i->index);
  1822 		SetDParam(0, i->index);
  1823 		AddNewsItem(str, NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY, 0), i->xy + TileDiffXY(1, 1), 0);
  1823 		AddNewsItem(str, NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY, 0), i->xy + TileDiffXY(1, 1), 0);
  1824 	}
  1824 	}
  1825 }
  1825 }
  1826 
  1826 
  1827 void IndustryMonthlyLoop(void)
  1827 void IndustryMonthlyLoop()
  1828 {
  1828 {
  1829 	Industry *i;
  1829 	Industry *i;
  1830 	PlayerID old_player = _current_player;
  1830 	PlayerID old_player = _current_player;
  1831 	_current_player = OWNER_NONE;
  1831 	_current_player = OWNER_NONE;
  1832 
  1832 
  1848 	_industry_sort_dirty = true;
  1848 	_industry_sort_dirty = true;
  1849 	InvalidateWindow(WC_INDUSTRY_DIRECTORY, 0);
  1849 	InvalidateWindow(WC_INDUSTRY_DIRECTORY, 0);
  1850 }
  1850 }
  1851 
  1851 
  1852 
  1852 
  1853 void InitializeIndustries(void)
  1853 void InitializeIndustries()
  1854 {
  1854 {
  1855 	CleanPool(&_Industry_pool);
  1855 	CleanPool(&_Industry_pool);
  1856 	AddBlockToPool(&_Industry_pool);
  1856 	AddBlockToPool(&_Industry_pool);
  1857 
  1857 
  1858 	_total_industries = 0;
  1858 	_total_industries = 0;
  1906 	SLE_CONDNULL(32, 2, SL_MAX_VERSION),
  1906 	SLE_CONDNULL(32, 2, SL_MAX_VERSION),
  1907 
  1907 
  1908 	SLE_END()
  1908 	SLE_END()
  1909 };
  1909 };
  1910 
  1910 
  1911 static void Save_INDY(void)
  1911 static void Save_INDY()
  1912 {
  1912 {
  1913 	Industry *ind;
  1913 	Industry *ind;
  1914 
  1914 
  1915 	/* Write the vehicles */
  1915 	/* Write the vehicles */
  1916 	FOR_ALL_INDUSTRIES(ind) {
  1916 	FOR_ALL_INDUSTRIES(ind) {
  1917 		SlSetArrayIndex(ind->index);
  1917 		SlSetArrayIndex(ind->index);
  1918 		SlObject(ind, _industry_desc);
  1918 		SlObject(ind, _industry_desc);
  1919 	}
  1919 	}
  1920 }
  1920 }
  1921 
  1921 
  1922 static void Load_INDY(void)
  1922 static void Load_INDY()
  1923 {
  1923 {
  1924 	int index;
  1924 	int index;
  1925 
  1925 
  1926 	_total_industries = 0;
  1926 	_total_industries = 0;
  1927 
  1927