Changeset - r6757:21bf9e5dc6b5
[Not reviewed]
master
0 3 0
belugas - 17 years ago 2007-05-30 20:20:58
belugas@openttd.org
(svn r9992) -Codechange: Remove some hardcoded references to Industry IDs.
A few more to go
3 files changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -1481,7 +1481,7 @@ int32 CmdBuildIndustry(TileIndex tile, u
 
			indspec->accepts_cargo[0] == CT_INVALID &&
 
			indspec->accepts_cargo[1] == CT_INVALID &&
 
			indspec->accepts_cargo[2] == CT_INVALID &&
 
			p1 != IT_LUMBER_MILL) {
 
			!(ind_spc->behaviour & INDUSTRYBEH_CUT_TREES) {
 
		return CMD_ERROR;
 
	}
 

	
 
@@ -1522,9 +1522,10 @@ static const byte _numof_industry_table[
 
static void PlaceInitialIndustry(IndustryType type, int amount)
 
{
 
	int num = _numof_industry_table[_opt.diff.number_industries][amount];
 
	const IndustrySpec *ind_spc = GetIndustrySpec(type);
 

	
 
	/* These are always placed next to the coastline, so we scale by the perimeter instead. */
 
	num = (type == IT_OIL_REFINERY || type == IT_OIL_RIG) ? ScaleByMapSize1D(num) : ScaleByMapSize(num);
 
	num = (ind_spc->check_proc == CHECK_REFINERY || ind_spc->check_proc == CHECK_OIL_RIG) ? ScaleByMapSize1D(num) : ScaleByMapSize(num);
 

	
 
	if (_opt.diff.number_industries != 0) {
 
		PlayerID old_player = _current_player;
 
@@ -1567,7 +1568,7 @@ void GenerateIndustries()
 
				int num = _numof_industry_table[_opt.diff.number_industries][chance];
 

	
 
				/* These are always placed next to the coastline, so we scale by the perimeter instead. */
 
				num = (it == IT_OIL_REFINERY || it == IT_OIL_RIG) ? ScaleByMapSize1D(num) : ScaleByMapSize(num);
 
				num = (ind_spc->check_proc == CHECK_REFINERY || ind_spc->check_proc == CHECK_OIL_RIG) ? ScaleByMapSize1D(num) : ScaleByMapSize(num);
 
				i += num;
 
			}
 
		}
src/openttd.cpp
Show inline comments
 
@@ -1781,7 +1781,7 @@ bool AfterLoadGame()
 
		FOR_ALL_INDUSTRIES(i) {
 
			uint j;
 

	
 
			if (i->type == IT_FARM || i->type == IT_FARM_2) {
 
			if (GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_PLANT_ON_BUILT) {
 
				for (j = 0; j != 50; j++) PlantRandomFarmField(i);
 
			}
 
		}
src/smallmap_gui.cpp
Show inline comments
 
@@ -430,7 +430,7 @@ static inline uint32 GetSmallMapVegetati
 
			break;
 

	
 
		case MP_INDUSTRY:
 
			bits = GetIndustryType(tile) == IT_FOREST ? MKCOLOR(0xD0D0D0D0) : MKCOLOR(0xB5B5B5B5);
 
			bits = GetIndustrySpec(GetIndustryByTile(tile)->type)->check_proc == CHECK_FOREST ? MKCOLOR(0xD0D0D0D0) : MKCOLOR(0xB5B5B5B5);
 
			break;
 

	
 
		case MP_TREES:
0 comments (0 inline, 0 general)