File diff r19737:d7c69e3b4bd4 → r19738:837a139219f0
src/newgrf_industries.cpp
Show inline comments
 
@@ -401,12 +401,22 @@ static uint32 GetCountAndDistanceOfClose
 
static const GRFFile *GetGrffile(IndustryType type)
 
{
 
	const IndustrySpec *indspec = GetIndustrySpec(type);
 
	return (indspec != NULL) ? indspec->grf_prop.grffile : NULL;
 
}
 

	
 
/**
 
 * Constructor of the industries resolver.
 
 * @param tile %Tile owned by the industry.
 
 * @param industry %Industry being resolved.
 
 * @param type Type of the industry.
 
 * @param random_bits Random bits of the new industry.
 
 * @param callback Callback ID.
 
 * @param callback_param1 First parameter (var 10) of the callback.
 
 * @param callback_param2 Second parameter (var 18) of the callback.
 
 */
 
IndustriesResolverObject::IndustriesResolverObject(TileIndex tile, Industry *indus, IndustryType type, uint32 random_bits,
 
		CallbackID callback, uint32 callback_param1, uint32 callback_param2)
 
	: ResolverObject(GetGrffile(type), callback, callback_param1, callback_param2),
 
	industries_scope(this, tile, indus, type, random_bits),
 
	town_scope(NULL)
 
{
 
@@ -433,12 +443,20 @@ TownScopeResolver *IndustriesResolverObj
 
		if (t == NULL) return NULL;
 
		this->town_scope = new TownScopeResolver(this, t, this->industries_scope.industry->index == INVALID_INDUSTRY);
 
	}
 
	return this->town_scope;
 
}
 

	
 
/**
 
 * Scope resolver for industries.
 
 * @param ro Surrounding resolver.
 
 * @param tile %Tile owned by the industry.
 
 * @param industry %Industry being resolved.
 
 * @param type Type of the industry.
 
 * @param random_bits Random bits of the new industry.
 
 */
 
IndustriesScopeResolver::IndustriesScopeResolver(ResolverObject *ro, TileIndex tile, Industry *industry, IndustryType type, uint32 random_bits)
 
	: ScopeResolver(ro)
 
{
 
	this->tile = tile;
 
	this->industry = industry;
 
	this->type = type;